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
| Database System | Support Status | Since Version | Notes |
|---|---|---|---|
| MySQL | Native | all | INNER keyword is optional; JOIN alone implies INNER JOIN. |
| PostgreSQL | Native | all | INNER keyword is optional; JOIN alone implies INNER JOIN. |
| SQL Server | Native | all | INNER keyword is optional; JOIN alone implies INNER JOIN. |
| Oracle | Native | all | INNER keyword is optional; JOIN alone implies INNER JOIN. |
| SQLite | Native | 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: Native in all listed versions
PostgreSQL: Native in all listed versions
SQL Server: Native in all listed versions
Oracle: Native in all listed versions
SQLite: Native in all listed versions
Per-Database Syntax & Notes
MySQL Native syntax
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 Native syntax
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 Native syntax
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 Native syntax
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 Native syntax
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;