This is part 12 of a 19 part series on TSQL Basics. You will first gain an understanding of the differences between each of these types of joins, and when they should be used. Then we’ll explore some common uses for joins, such as replacing a not in clause with join to get the same results with better performance. You will take home the right foundations to get at the data that you want. Make sure to check of the other parts in this series in my JOIN Types playlist.
>>> Try our JOIN Types Course Today!
Transcription:
0:07
Next, we have the OUTER APPLY. And this is a lot like, instead of an INNER JOIN, where it’s gonna be a lot like a LEFT OUTER JOIN between a table and a table valued function. And you may wonder, is there any equivalent to a RIGHT OUTER JOIN. And no, it’s either raw supply or OUTER APPLY. One of them acts like an inner join, the other one acts like a LEFT OUTER JOIN. And when we take a look at the cross, or the OUTER APPLY, when we run that before, we were only getting those that matched up because it was treated like an INNER JOIN, but now we’re back to getting Johnny and Karen who are listed down here who did not have a favorite color using that OUTER APPLY. And that OUTER APPLY can be used with a function table valued function, or it can be used with a sub correlated sub query like we have here. Also, just a reminder, you can download the JOIN types poster at SteveStedman.com. And this is a poster I created a few years ago that just sort of shows how all the different joins that we’re going to be covering through this presentation are done. It’s handy to print out and keep on your cube wall or near your workspace.
Our JOIN Types course comes with:
• Easy to understand lectures with examples
• Assignments
• Sample code to work with
More from Stedman Solutions:
Steve and the team at Stedman Solutions are here for all your SQL Server needs.
Contact us today for your free 30 minute consultation..
We are ready to help!