DELAPARRA
Index
Color
NL
Category: SQL

FULL OUTER JOIN

Explained by Updated

What is FULL OUTER JOIN?

FULL OUTER JOIN: Keeps unmatched rows from BOTH sides, filling missing columns with NULL. A FULL OUTER JOIN returns all rows from both tables. Where rows match, they are combined. Where a row has no match on the other side, the missing columns are filled with NULL. It is useful for comparing two data sets. Matching an export from your webshop with an export from your accounting system shows orders that exist in only one of them, and those are exactly the ones you want to investigate.

Definition source Coders Lingo, CC BY 4.0

Frequently asked questions about FULL OUTER JOIN

What should you keep in mind with FULL OUTER JOIN?

MySQL does not support FULL OUTER JOIN directly. You get the same result by combining a LEFT JOIN and a RIGHT JOIN with UNION. PostgreSQL and SQL Server support it natively. In everyday application queries it is rare; it mainly appears in reconciliation and reporting, where missing data is exactly what you are looking for.

What does an example of FULL OUTER JOIN look like?

SELECT u.name, o.total FROM users u FULL OUTER JOIN orders o ON o.user_id = u.id;

At a glance

CategorySQL
Explained by
Updated

More SQL terms

All terms starting with F

Skills

Download all skills (zip)

Manuals

Related services

Need any help?

Stuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.