| emp_id | dept | |--------|----------| | 1 | Sales | | 3 | Marketing| | 4 | Eng |
This guide covers syntax, use cases, behavioral nuances, and performance considerations. 1. What is FULL OUTER JOIN ? A FULL OUTER JOIN (often abbreviated as FULL JOIN ) returns all rows from both tables. When a match is found based on the join condition, it combines columns from both tables. When no match exists, it still includes the unmatched row, filling the missing side’s columns with NULL .
LEFT JOIN + RIGHT JOIN + deduplication. 2. Syntax SELECT a.column1, b.column2 FROM table_a a FULL OUTER JOIN table_b b ON a.join_key = b.join_key; Note: Presto also accepts FULL JOIN as shorthand. 3. Visual Example Table A (Employees): | emp_id | name | |--------|---------| | 1 | Alice | | 2 | Bob | | 4 | David |