>Hi Sergey,
>
>Sorry for the delayed reply.. have been quite busy.
>
>I thought this was in fact a correlated subquery. Most of the examples of these have been where the correlated subquery part is in the where clause, not in the select list, but apparently it can be done in the select list as well.
>
>I am trying though to understand the order of execution, i.e. my understanding is that for every row returned by the main query the correlated subquery executes once? Is that correct?
Hi David,
SQL is declarative language. It describes what result you want SQL Server to return. How to get the result is up to SQL Server Query Optimizer. Look at the query excution plan if you want to know how query is actualy excuted.
--sb--