OUTER JOIN is a family of JOIN operations (LEFT, RIGHT, and FULL) that augment an INNER JOIN by also including rows that do not satisfy the join predicate. • LEFT OUTER JOIN keeps all rows from the left table. Non-matching columns from the right table are returned as NULL.• RIGHT OUTER JOIN keeps all rows from the right table. Non-matching columns from the left table are returned as NULL.• FULL OUTER JOIN keeps all rows from both tables, returning NULLs where a partner row is absent.Because unmatched data is preserved, OUTER JOIN is ideal for exception reporting, coverage analysis, slowly changing dimensions, and optional relationships. Performance depends on index quality and predicate selectivity. Many databases allow the optional OUTER keyword; writing LEFT JOIN is identical to LEFT OUTER JOIN. SQLite lacks FULL OUTER JOIN natively; work-arounds use UNION or subqueries. Cartesian explosion is impossible because only one copy of each preserved row is returned.
table1
(table or subquery) - The left input set.table2
(table or subquery) - The right input set.join_condition
(boolean expression) - Predicate that defines row matching.join_type
(keyword) - LEFT, RIGHT, or FULL determines which side(s) preserve unmatched rows.JOIN, INNER JOIN, LEFT JOIN, RIGHT JOIN, FULL JOIN, CROSS JOIN, NATURAL JOIN, USING, ON clause
SQL-92 standard
LEFT OUTER JOIN keeps every row from the left table, while RIGHT OUTER JOIN keeps every row from the right table. The non-preserved side returns NULLs where no match exists.
Usually yes, because the database must keep additional rows. Indexes on join keys and selective predicates reduce the gap.
Combine two queries: one LEFT JOIN and one RIGHT JOIN (or a UNION of LEFT JOIN with reversed tables) and remove duplicates with UNION or UNION ALL plus filtering.
Avoid when you only need matching rows, because OUTER JOIN adds overhead and complexity. Use INNER JOIN instead for pure intersection queries.