bugl
bugl
HomeLearnPatternsSearch
HomeLearnPatternsSearch

Loading lesson path

Learn/SQL/SQL References
SQL•SQL References

SQL FULL OUTER JOIN Keyword

Concept visual

SQL FULL OUTER JOIN Keyword

Pointer walk
two pointers
leftright102132436485116
left=0
right=6
1
3

Start at both ends

FULL OUTER JOIN Keyword

Previous

❮ SQL Keywords

Next

Full Outer Join

The FULL OUTER JOIN

command returns all rows when there is a match in either left table or right table. The following SQL statement selects all customers, and all orders:

SELECT Customers.CustomerName, Orders.OrderID

FROM Customers

FULL OUTER JOIN Orders

Formula

ON Customers.CustomerID = Orders.CustomerID
ORDER BY Customers.CustomerName;

Note:

The FULL OUTER JOIN

keyword returns all the rows from the left table (Customers), and all the rows from the right table (Orders). If there are rows in "Customers" that do not have matches in "Orders", or if there are rows in "Orders" that do not have matches in "Customers", those rows will be listed as well.

Previous

❮ SQL Keywords

Next

Previous

SQL FROM Keyword

Next

SQL GROUP BY Keyword