INNER JOIN¶
Combines rows from two sources based on a join condition. INNER JOIN returns only the rows where the join condition is satisfied in both tables.
Syntax¶
The INNER JOIN clause is used in SELECT statements:
SELECT columns
FROM table1 INNER JOIN table2
ON table1.column = table2.column
The JOIN keyword can be used as a shorthand for INNER JOIN:
Parameters¶
sourceThe table or subquery to join with.
ON joinConditionA boolean expression that specifies the join condition. Only rows where this condition evaluates to true are included in the result.
USING (column(s))A comma-separated list of column names that exist in both tables. This is shorthand for joining on equality of these columns. The USING clause automatically removes duplicate columns from the result set.
Returns¶
Returns a result set containing rows where the join condition is satisfied. For each matching pair of rows from the two sources, a combined row is produced with columns from both tables.
For more details see Joins.