Outer join
An outer join combines matching rows while preserving unmatched rows from one or both inputs and representing missing counterparts with null values.
DuckDB in Action
A full outer join preserves unmatched rows from both input relations and supplies NULLs on the missing sides.
- How it is used
- Preserves all systems or records when either side may lack optional matching information.
- How deep it goes
- Derives joins from Cartesian products and filtering, then demonstrates full outer join behavior with a small VALUES dataset.
- Examples
- Demonstrates joins over two VALUES relations keyed by id, producing matches and NULL-filled unmatched rows.
- What you can do after
- Apply it via DuckDB SQL to combine relations without discarding keys appearing on only one side.
Learn SQL in a Month of Lunches
A full outer join returns matching rows and preserves unmatched rows from both joined inputs, filling missing columns with null values.
- How it is used
- Combines complete results from two related tables when matching and unmatched rows from both sides matter.
- How deep it goes
- Defines the result and portability limits, but defers a full query walkthrough and alternative construction.
- Examples
- Uses promotion and orderheader tables to show matching rows and unmatched rows containing nulls.
- What you can do after
- Apply it via SQL to combine two tables while retaining unmatched rows from both inputs.
Read how Learn SQL in a Month of Lunches explains outer join →
Related concepts
- joinkind of · A join is an operation that combines records or rows from multiple data sources according to specified matching conditions or relationships.
- Hibernateused by · Hibernate is a Java object-relational mapping and persistence framework that maps application objects to relational database data.
- inner joincontrasts with · An inner join is a relational operation that returns combinations of rows only when the join condition matches records in both input relations.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

