Skip to content

Non ancora disponibile in italiano. Vedi tutto ciò che è disponibile in italiano

Stockertim Dictionary · Technology

Inner join

Also called SQL inner join, matching join, equi-join

In short

A join that returns only the rows with a match in both tables, dropping any row from either side that has no partner, without warning.

  • Beginner
  • Concept
  • Checked

In detail

An inner join is the intersection of two tables on a key. Writing JOIN on its own, or INNER JOIN in full, tells the database to pair rows whose key values satisfy the ON condition and to return only those pairs. A row in either table that finds no partner simply does not appear in the result.

That behaviour is exactly right when only matched records matter. Listing invoices with their customer names, where every invoice is known to have a valid customer, needs nothing more. It also works as a filter: joining sales to a short table of featured products returns only sales of those products.

The risk is the silence. If ten sales carry a product code missing from the catalogue, an inner join drops them, and any total calculated afterwards is ten sales short with no error message. The result looks complete because nothing in it is wrong; what is wrong is what is absent.

The standard checks are simple. Count the rows of the main table before the join and of the result after it, and compare totals of a key amount. If the numbers differ, rerun the query as a left join with WHERE right_table.key IS NULL to list the rows that failed to match, then decide whether they are errors to fix or rows that truly belong outside the answer.

Worked example

A pharmacy group in Durban joins 2,000 prescription rows to its medicines table to report sales by medicine class.

  1. The inner join returns 1,980 rows, so 2,000 − 1,980 = 20 prescriptions were dropped.
  2. The 20 rows use a new medicine code not yet added to the medicines table.
  3. Dropped value: 20 prescriptions × R150 = R3,000

After the code is added, the join returns all 2,000 rows and the class totals rise by R3,000.

In practice

Inner joins are the everyday default in reporting queries and in many tools that build queries from drag-and-drop screens. Careful analysts keep a habit of checking the row count after each one, and of writing a short note when rows are knowingly excluded.

Watch out

  • No error is raised when unmatched rows disappear; only a row count or a control total reveals the loss.
  • Chaining several inner joins compounds the loss: a row must match in every table to survive.

Learn it properly

Official sources

Facts last checked on 9 November 2026.

Education, not advice: the Stockertim Dictionary explains what terms mean. It never recommends buying or selling anything.

English