TSQL Basics Part 9: FULL OUTER JOIN – Video Explanation
This is part 9 “full outer JOIN 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:
The FULL OUTER JOIN can get interesting because this is kind of like saying, let’s do both a LEFT OUTER join and a RIGHT OUTER JOIN at the same time. So what is trying to do, it’s matching up every row from both tables that match, just like an inner join would, but then it’s going to show all of those that are in table two that don’t match table one. And then it’s also going to show all of those from table one that don’t match table two. So let’s take a look at the FULL OUTER JOIN. Just select so all we’ve done is we’ve taken the left or the RIGHT OUTER JOIN and change it to a FULL OUTER JOIN here. We run that and we can see the first rows that all match up scrolling down here, those are the same that we saw on an inner join. These next two are the ones that we saw on a LEFT OUTER JOIN with Johnny and Karen not having a favorite color. And then the last three are those that we saw on a RIGHT OUTER JOIN were pink, mauve and orange. Were not colors that were selected by anyone.
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!
Leave a Reply