How do you personally explain the difference between Cross Apply and Cross Join?
ActiveOps 1
Cross join is between two tables or two sub queries, whereas the cross apply is most commonly used to join a table to the results of a TVF.
Having said that, a cross join is every possible combination from both tables or sub queries, so isn’t really comparable to the cross apply. You would really be comparing an inner join to a cross apply.
In terms of the mechanics, the inner join and cross apply are similar by returning matching rows from both outputs.
1
Provest 1
An apply can supply a single row data or many to already existing data. A join can supply multiple rows and and create new ones depending on if it’s an inner, left, or right. Applies are useful for giving a single row of results sorted by date or ID desc
Cross join is between two tables or two sub queries, whereas the cross apply is most commonly used to join a table to the results of a TVF. Having said that, a cross join is every possible combination from both tables or sub queries, so isn’t really comparable to the cross apply. You would really be comparing an inner join to a cross apply. In terms of the mechanics, the inner join and cross apply are similar by returning matching rows from both outputs.
An apply can supply a single row data or many to already existing data. A join can supply multiple rows and and create new ones depending on if it’s an inner, left, or right. Applies are useful for giving a single row of results sorted by date or ID desc