SQL Server - SQL CROSS APPLY Statement

Using CROSS APPLY In SQL SELECT Statements

In this article I  take you through the following:

  • CROSS APPLY
  • OUTER APPLY
  • CROSS APPLY with User Defined Table Valued Functions

When Should We Use The CROSS APPLY Statement

The CROSS APPLY statement behaves in a similar fashion to a correlated subquery, but allows us to use ORDER BY statements within the subquery. This is very useful where we wish to extract the top record from a sub query to use in an outer sub query.