liveBook · Manning

Inner join

As explained in DuckDB in Action

An inner join returns row pairs whose join condition matches on both input relations.

An inner join combines rows from two relations only when their join condition matches. It is the default join and fits workflows that combine readings with system or pricing data. section 3.4.4

Use an inner join to:

  • Write shared-key joins concisely with USING; express different key names or conditions with ON. section 3.4.4

Join two virtual tables

SELECT * FROM (VALUES (1, 'a1'), (2, 'a2'), (3, 'a3')) l(id, nameA) JOIN (VALUES (1, 'b1'), (2, 'b2'), (4, 'b4')) r(id, nameB) USING (id); The result contains ids 1 and 2 only: (1, a1, b1) and (2, a2, b2).

How DuckDB in Action covers it

How deep it goes
Explains matching, USING, and duplicate-key behavior, relating joins to Cartesian products without developing join internals further.
Examples
Demonstrates VALUES relations, equal-key output, duplicate keys, readings-and-systems aggregation, and chained CSV joins.
What it assumes
Assumes familiarity with relations, columns, SELECT, FROM, and equality conditions; teaches shared-key matching from concrete VALUES examples.
What you can do after
Apply it via DuckDB SQL to retain only matching rows while combining tables, virtual relations, subqueries, or files.
How it connects
Connects inner join with CROSS JOIN, outer join, ON, USING, subqueries, common table expressions, and aggregation.

Also explained in

Compare how 3 books explain inner join →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of DuckDB in Action. The section links point to the parts of the book it draws on.