The APPLY clause let’s you join a table to a table-valued-function.
The APPLY clause acts like a JOIN without the ON clause comes in two flavours: CROSS and OUTER.
The OUTER APPLY clause returns all the rows on the left side table whether they return any rows in the table-valued-function or not, and thus similar to a left join).n
The columns that the table-valued-function returns are null if no rows are returned.
The CROSS APPLY only returns rows from the left side table if the table-valued-function returns rows.
- OUTER APPLY acts like a LEFT JOIN.
- CROSS APPLY acts like a RIGHT JOIN.