FULL OUTER JOIN

FULL OUTER JOIN keeps all rows from both tables, filling the missing side with NULL. See the union of LEFT and RIGHT joins visualized.

Join type

Data (click a cell to edit)

SELECT * FROM A
FULL OUTER JOIN B
  ON A.key = B.key

ON A.key = B.key — empty keys are treated as SQL NULL and never match

Table A

keyval

Table B

keyval
Matched rowsRows only in ARows only in B

Result

Result rows: 4Matched: 2A only: 1B only: 1
A.keyA.valB.keyB.val
1kim1dev
3park3hr
2leeNULLNULL
NULLNULL4fin

Edit a key or add a row — the connector lines and result update instantly. The 'Duplicate key' preset shows why LEFT JOIN row counts can grow.

FULL OUTER JOIN combines LEFT and RIGHT: every row from both tables survives, with NULL padding on the unmatched side.

Its killer use case is diffing two datasets — FULL JOIN the old and new tables, filter where either key IS NULL, and you instantly see rows that exist on only one side.

MySQL doesn't support FULL OUTER JOIN; the standard workaround is UNION of a LEFT JOIN and a RIGHT JOIN. SQL JOIN Visualizer

Frequently asked questions

How do I do a FULL OUTER JOIN in MySQL?
UNION a LEFT JOIN and a RIGHT JOIN (or a LEFT JOIN with tables swapped). UNION deduplicates so matched rows appear once.
How do I get only the rows that exist on one side?
FULL OUTER JOIN with WHERE A.key IS NULL OR B.key IS NULL gives the symmetric difference — a classic table-diff pattern.

Other joins