From the course: SQL Server Fundamentals: Master Basic Query Techniques

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Outer joins

Outer joins - SQL Tutorial

From the course: SQL Server Fundamentals: Master Basic Query Techniques

Start my 1-month free trial

Outer joins

- [Instructor] Now we're going to move on to a different type of join that you'll use pretty frequently called an outer join. There are a few different types of outer joins but the one I think you will run into most frequently is the left outer join. So that's the one I'm going to demo for you in this video. Like the inner join, the outer join allows us to retrieve information from a second table based on a related key value. But it always does so without filtering the results from the first table in your join order. We're going to refer to that first table as the anchoring table. In an outer join as you see in the highlighted area on this diagram, you'll get to keep all of the data in your anchoring table, along with anything that matches in the secondary table added to the query through an outer join. So here we want to get the full name and the order total for every customer named Sydney in our database. So, we know how to write the first part of that query. Select star from the…

Contents