left_table { LEFT | RIGHT | FULL } [ OUTER ] JOIN right_table ON join_condition
Syntax Elements
- left_table
- Table reference that appears to the left of the join type keywords.
- LEFT [ OUTER ]
- Outer join with the table that was listed first in the FROM clause.
- In a LEFT OUTER JOIN, the rows from the left table that are not returned in the result of the inner join of the two tables are returned in the outer join result and extended with nulls.
- RIGHT [ OUTER ]
- Outer join with the table that was listed second in the FROM clause.
- In a RIGHT OUTER JOIN, the rows from the right table that are not returned in the result of the inner join of the two tables are returned in the outer join result and extended with nulls.
- FULL [ OUTER ]
- Rows are returned from both tables.
- In a FULL OUTER JOIN, rows from both tables that have not been returned in the result of the inner join are returned in the outer join result and extended with nulls.
- right_table
- Table reference that appears to the right of the join type keywords.
- join_condition
- Columns on which the join is made separated by the comparison operator that specifies the comparison type for the join.
- The join conditions of an ON clause define the rows in the left table that take part in the match to the right table. At least one join condition is required in the ON clause for each table in the outer join.
- You can include multiple join conditions in an ON clause by using the Boolean AND, OR, and NOT operators.