Search⌘ K

Left and Right Joins

Explore how left and right joins work in SQL to retrieve complete data sets from multiple tables, including unmatched rows. Understand the syntax, differences, and practical applications to improve your querying capabilities and database management.

Left & Right Joins

In this lesson we’ll look at left and right joins. The two joins add additional rows to the result set for one of the tables participating in the join. We can best exemplify the two joins pictorially as follows:

Left Join

Right Join

Syntax for Left Join

SELECT *

FROM table1

LEFT [OUTER] JOIN table2

ON <join condition>

Syntax for Right Join

SELECT *

FROM table1

RIGHT [OUTER] JOIN table2

ON ...