>
>I think CROSS APPLY and the Subquery shown by Walter are actually equivalent. I prefer CROSS APPLY as we can have more than 1 column.
>
>Brad Schulz had a blog explaining that CROSS APPLY and subquery is the same.
I personally like CROSS APPLY, but I have to acknowledge it can be a little more costly on IO/TIME statistics and the execution plan.
What is kind of amazing is how much Microsoft has optimized correlated subqueries over time. As recently as SQL 2000 (which was used by many deep into the second part of the decade), execution plans for correlated subqueries were often horrible. But by the next release the optimizer did a much better job with them