Cross apply and outer apply are similar to join.
They are mainly engaged in M * n Cartesian sets. The obvious feature is that on joins are not used.
It is also reasonable to think about it. The application scenario should meet the join constraint, mainly for example, the function that returns table variables,
It seems that the difference is still unclear. For example, return the three most recent orders of a customer or return the five most popular products in all categories.
The Top N operation won't work well if we use join. Haha, but it's not impossible to use row_number () partition.
Here, it's easy to use apply. If I don't write it out, I can't remember how to write it after a month.
Another silly way is to traverse all the customers, retrieve the three most recent orders of each user, and insert them to a zero-time table,
This method can also be considered for a small quantity. After all, the method is relatively simple, and you do not need to use the advanced features of SQL Server 2005 +.