Reply to Re: NULL values in a SELECT in another SELECT

Your name:

Reply:


Posted by Serge Rielau on 01/24/08 17:24

Serge Rielau wrote:
>> S. Rielau : the problem is the "WHERE B1.x=F.x".
>> If I write SELECT X FROM F, (SELECT ... FROM B1 WHERE B1.x=F.x) AS F1
>> SQL Server doesn't recognize F.x.
> That's not what I wrote.
> You can put the WHERE on the outer SELECT.
Let me qualify:
Assuming the WHERE clause can be pulled up.
E.g. if you repeated it in both branches of the UNION ALL (which I
forgot about)
If you can't pull the WHERE up the correlated join (APPLY/LATERAL) is
your only efficient way to wrote it.

Cheers
Serge

--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация