FULL OUTER JOIN is a set-combining join type defined in the SQL-92 standard. It unifies the results of a LEFT JOIN and a RIGHT JOIN, producing every row from the left table and every row from the right table. When a row in one table lacks a counterpart that satisfies the ON condition in the other, the missing side’s columns are returned as NULL. Because it retains unmatched data from both tables, FULL OUTER JOIN is ideal for reconciliation, auditing, and comparative analysis. Some databases require the keyword OUTER, while others accept FULL JOIN as shorthand. Performance can degrade on very large tables if indexes on the join keys are lacking, and not all SQL engines support it natively (for example, MySQL requires a UNION workaround).
table1
(table) - Left input tabletable2
(table) - Right input tableON condition
(boolean) - Expression that defines matching rows, typically an equality between keys.LEFT JOIN, RIGHT JOIN, INNER JOIN, CROSS JOIN, UNION, COALESCE
SQL-92
INNER JOIN returns only rows that satisfy the join condition in both tables. FULL OUTER JOIN returns those matches plus every non-matching row from both tables, padding NULLs where data is missing.
Add a WHERE clause that checks for NULLs on either side of the join key:```... FULL OUTER JOIN ...WHERE table1.key IS NULL OR table2.key IS NULL;```
Large tables without indexes on the join keys force a full scan and expensive hash or sort-merge joins. Create indexes on the columns used in the ON condition or limit the dataset with predicates.
Yes, in dialects that support the USING syntax (PostgreSQL, Oracle, Snowflake). It simplifies syntax when the join columns share the same name:```SELECT *FROM a FULL JOIN b USING (id);```