Performing Inner Joins on Multiple Columns Using SQL/92 : SQL 92 Syntax « Table Joins « Oracle PL/SQL Tutorial






If your join uses more than one column from the two tables, you provide those columns in your ON clause along with the AND operator.

SELECT ...
FROM table1 INNER JOIN table2
ON table1.column1 = table2.column1
AND table1.column2 = table2.column2;

You can further simplify your query though the USING clause, but only if you're performing an equijoin and the column names are identical.

For example, the following query rewrites the previous example with the USING clause:

SELECT ...
FROM table1 INNER JOIN table2
USING (column1, column2);








7.9.SQL 92 Syntax
7.9.1.Performing Joins Using the SQL/92 Syntax
7.9.2.Performing Inner Joins on Multiple Columns Using SQL/92
7.9.3.Performing Inner Joins on Two Tables Using SQL/92, on clause