Combine rows from two or more tables based on a related column. All core join types are universally supported. Search for a specific type: <a href="#" onclick="searchCommand('inner join'); return false;">INNER JOIN</a>, <a href="#" onclick="searchCommand('left join'); return false;">LEFT JOIN</a>, <a href="#" onclick="searchCommand('right join'); return false;">RIGHT JOIN</a>, <a href="#" onclick="searchCommand('full outer join'); return false;">FULL OUTER JOIN</a>, <a href="#" onclick="searchCommand('cross join'); return false;">CROSS JOIN</a>.

Combines rows from two or more tables based on a related column. INNER JOIN drops rows with no match; OUTER JOIN (LEFT/RIGHT/FULL) preserves them. Missing join conditions create Cartesian products -- always double-check your ON clauses.

Compatibility

Filter by Database
SQL JOIN Compatibility Across Databases
Database System Support Status Since Version Notes
MySQL Native all All standard join types supported.
PostgreSQL Native all All standard join types supported.
SQL Server Native all All standard join types supported.
Oracle Native all All standard join types supported. Legacy (+) outer-join syntax also exists.
SQLite Native all All join types supported; RIGHT JOIN and FULL OUTER JOIN added in 3.39.0.

Details

SQL JOINs are the primary mechanism for combining rows across tables. See specific types: INNER JOIN, LEFT JOIN, RIGHT JOIN, FULL OUTER JOIN, CROSS JOIN.

Standard Syntax

SELECT a.col, b.col FROM table_a a 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

All standard join types supported.

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

PostgreSQL Native syntax

All standard join types supported.

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

SQL Server Native syntax

All standard join types supported.

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

Oracle Native syntax

All standard join types supported. Legacy (+) outer-join syntax also exists.

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

SQLite Native syntax

All join types supported; RIGHT JOIN and FULL OUTER JOIN added in 3.39.0.

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