Outer Joins in SQL/92 Syntax
SQL/92 syntax for performing outer joins:
FROM table1 { LEFT | RIGHT | FULL } OUTER JOIN table2
- LEFT means a left outer join.
- RIGHT means a right outer join.
- FULL means a full outer join.
A full outer join uses all rows in table1 and table2. A full outer join includes null values in the columns used in the join.
Left Outer Joins Using SQL/92
Query using (+):
SELECT p.name, pt.name
FROM projects p, project_types pt
WHERE p.project_type_id = pt.project_type_id (+)
ORDER BY p.name;
Query using the SQL/92 LEFT OUTER JOIN
keywords:
SELECT p.name, pt.name
FROM projects p LEFT OUTER JOIN project_types pt
USING (project_type_id)
ORDER BY p.name;
Performing Right Outer Joins Using SQL/92
Query using (+):
SELECT p.name, pt.name
FROM projects p, project_types pt
WHERE p.project_type_id (+) = pt.project_type_id;
Query using the SQL/92 RIGHT OUTER JOIN keywords:
SELECT p.name, pt.name
FROM projects p RIGHT OUTER JOIN project_types pt
USING (project_type_id)
ORDER BY p.name;
Full Outer Joins Using SQL/92
A full outer join uses all rows in the joined tables, including null values in either of the columns used in the join.
SELECT p.name, pt.name
FROM projects p FULL OUTER JOIN project_types pt
USING (project_type_id)
ORDER BY p.name;
Home »
Oracle »
Select »
Oracle »
Select »
Join:
- Table Join
- Using Table name to reference duplicate names
- Table Alias
- Cartesian Products
- Join more than two tables
- Join Conditions and Join Types
- Outer Joins
- Left and Right Outer Joins
- Outer join Error
- Self Join
- Outer Self Join
- Inner Joins Using SQL/92
- Joins with USING Keyword
- Inner Joins with More than Two Tables Using SQL/92
- Inner Joins on Multiple Columns Using SQL/92
- Outer Joins in SQL/92 Syntax
- Self Joins Using SQL/92
- Cross Joins Using SQL/92
Related: