March 2009
Intermediate to advanced
832 pages
23h 49m
English
This chapter covers two query elements that might seem unrelated. One element is the TOP option, which allows you to limit the number of rows affected by a query. The other is the APPLY table operator, which allows you to apply a table expression to each row of another table expression—basically creating a correlated join. I decided to cover both elements in the same chapter because I find that quite often you can use them together to solve querying problems.
I’ll first describe the fundamentals of TOP and APPLY and then follow with solutions to common problems using these elements.