Returns only rows where the join condition matches in both tables.

Returns only rows that have matching values in both tables, discarding non-matching rows from either side. Efficient for strict lookups. If you suspect rows might be missing, add an anti-join or full outer join to audit the fallout.

Compatibility

Show:
Database System Support Status Since Version Notes
MySQL ✓ Supported all INNER keyword is optional; JOIN alone implies INNER JOIN.
PostgreSQL ✓ Supported all INNER keyword is optional; JOIN alone implies INNER JOIN.
SQL Server ✓ Supported all INNER keyword is optional; JOIN alone implies INNER JOIN.
Oracle ✓ Supported all INNER keyword is optional; JOIN alone implies INNER JOIN.
SQLite ✓ Supported all INNER keyword is optional; JOIN alone implies INNER JOIN.

Details

The most common join type. Rows with no match in either table are excluded from the result.

Standard Syntax

SELECT a.col, b.col FROM table_a a INNER JOIN table_b b ON a.id = b.a_id;

Version Support

MySQL: Since all PostgreSQL: Since all SQL Server: Since all Oracle: Since all SQLite: Since all

Per-Database Syntax & Notes

MySQL

INNER keyword is optional; JOIN alone implies INNER JOIN.

SELECT a.col, b.col FROM a INNER JOIN b ON a.id = b.a_id;

PostgreSQL

INNER keyword is optional; JOIN alone implies INNER JOIN.

SELECT a.col, b.col FROM a INNER JOIN b ON a.id = b.a_id;

SQL Server

INNER keyword is optional; JOIN alone implies INNER JOIN.

SELECT a.col, b.col FROM a INNER JOIN b ON a.id = b.a_id;

Oracle

INNER keyword is optional; JOIN alone implies INNER JOIN.

SELECT a.col, b.col FROM a INNER JOIN b ON a.id = b.a_id;

SQLite

INNER keyword is optional; JOIN alone implies INNER JOIN.

SELECT a.col, b.col FROM a INNER JOIN b ON a.id = b.a_id;