Cross & Outer Apply

preview_player
Показать описание
In this video I'll discuss cross/outer apply and when you should use them. I will also show you how they differ from regular joins.
Рекомендации по теме
Комментарии
Автор

Been doing SQL for +20 years and bumped into these statements in a query of a colleague. So looked up your explanation. Quite useful functionality. Thanks!

bartvandenpoel
Автор

Great video. this really explains clearly and basically how apply operator works and how it works differently to join

KeithyM
Автор

Most clear tutorial i've even seen.

charlotxtreme
Автор

probably the best explanation AND example for Cross Apply and Outer Apply. Super useful! Can't wait to test it out at work.

supersql
Автор

Thank you very much.
I did meet this syntax on procedures I was working on without understanding what it is and I wasn't confident with my understanding of the documentation.
Now I was working on a problem of the same kind as the last example. I did try many things. I had a query that was functionnally OK but the performance was awful.
We have an expert SQL dev in the team and he did me a proposition to solve this, but it is not quite exactly solving the issue but just close and the performance is way better.
Guess it is his way to put me on the way without disclosing the full answer. After all I need to learn that thing.
With your video I understand what it does and what I should do to completely solve the problem.

uchitesting
Автор

Clear, articulate, simple. Excellent

salence
Автор

Great explanation, thank you. At 9:17 I was thinking "this made a lot of sense, but I wish I could get a final summary of the difference between Cross apply and Outer apply" and then you made that summary doing the last minute!

satori
Автор

Such a great video. Excellent explanation. Thank you!

shvideo
Автор

Very good explanation! Got to see how it starts with a join, and evolves to apply. Thanks for the good content!

Two questions:

1. Is there any case where we only want to use APPLY over other functions?

2.In the cross apply example that returns top 2 rows for each person, I guess using ROW_NUM() would also work. How would it differ from using apply here? Is it performance wise?

haowen
Автор

Thank you for this video, it's the best explanation I've seen.
Question: Is it fair to say that outer apply and left join are interchangeable?

alexintel
Автор

Now we can just use merge? Same thing?

chriskeo