When working with databases, joining tables is a fundamental operation that allows you to combine rows from two or more tables based on a related column. The SQL language provides several types of joins, including INNER JOIN, LEFT JOIN, RIGHT JOIN, and FULL OUTER JOIN. In this article, we will explore the concept of an outer join without an ON clause, which is a less common but still useful technique in specific scenarios.
Introduction to Outer Joins

An outer join is used to return all records from one table and the matching records from the other table. If there are no matches, the result will contain NULL values for the columns from the second table. The main difference between an outer join and an inner join is that an outer join will return all records from at least one of the tables, whereas an inner join will only return records where there are matches in both tables.
Types of Outer Joins
There are three main types of outer joins:
- LEFT OUTER JOIN: Returns all records from the left table and the matching records from the right table. If there are no matches, the result will contain NULL values for the columns from the right table.
- RIGHT OUTER JOIN: Similar to a LEFT OUTER JOIN, but returns all records from the right table and the matching records from the left table.
- FULL OUTER JOIN: Returns all records from both tables, with NULL values in the columns where there are no matches.
Outer Join Without On Clause

A standard outer join operation uses an ON clause to specify the join condition, which defines how rows from one table are matched with rows from the other table. However, in some databases, such as Oracle, you can perform an outer join without an ON clause by using the (+) operator. This syntax is specific to Oracle and is not supported in all databases.
For example, consider two tables, DEPARTMENTS and EMPLOYEES, where you want to perform a LEFT OUTER JOIN to retrieve all departments and their corresponding employees. Using the (+) operator, the query would look like this:
SELECT d.department_name, e.employee_name
FROM departments d, employees e
WHERE d.department_id = e.department_id(+);
This query will return all rows from the DEPARTMENTS table and the matching rows from the EMPLOYEES table. If there are no matches, the result will contain NULL values for the columns from the EMPLOYEES table.
Limitations and Considerations
While the (+) operator can be used to perform an outer join without an ON clause, it has some limitations and considerations:
- Not all databases support this syntax. It is specific to Oracle and may not work in other databases such as MySQL, PostgreSQL, or SQL Server.
- The (+) operator can only be used with the WHERE clause, not with the JOIN clause.
- This syntax can make the query more difficult to read and understand, especially for complex joins.
Join Type | Description |
---|---|
INNER JOIN | Returns only the rows that have a match in both tables. |
LEFT OUTER JOIN | Returns all rows from the left table and the matching rows from the right table. |
RIGHT OUTER JOIN | Returns all rows from the right table and the matching rows from the left table. |
FULL OUTER JOIN | Returns all rows from both tables, with NULL values in the columns where there are no matches. |

Key Points
- An outer join without an ON clause can be performed using the (+) operator in Oracle databases.
- The (+) operator can only be used with the WHERE clause, not with the JOIN clause.
- This syntax has limitations and considerations, including compatibility issues with other databases.
- Standard JOIN syntax with an ON clause is generally recommended for better readability and compatibility.
- Understanding the differences between various types of joins is essential for effective database querying.
In conclusion, while an outer join without an ON clause can be performed using the (+) operator in Oracle databases, it's essential to understand the limitations and considerations of this syntax. Standard JOIN syntax with an ON clause is generally recommended for better readability and compatibility across different databases.
What is the purpose of an outer join in SQL?
+An outer join is used to return all records from one table and the matching records from the other table. If there are no matches, the result will contain NULL values for the columns from the second table.
Can I use the (+) operator with other databases besides Oracle?
+No, the (+) operator is specific to Oracle and may not work in other databases such as MySQL, PostgreSQL, or SQL Server.
What are the limitations of using the (+) operator for outer joins?
+The (+) operator can only be used with the WHERE clause, not with the JOIN clause, and can make the query more difficult to read and understand, especially for complex joins.