Outer Joins & Where Clause

SQL
Author

Imad Dabbura

Published

October 15, 2022

With an outer join such as LEFT OUTER JOIN, we typically want all the records from the left table and records from right table that satisfy the join condition. However, if we include any field from the right table in the where clause, the join becomes an INNER JOIN for the following reason:

The above works the same for any form of OUTER JOIN.

To work around this, add the predicate to join statement after ON clause.