Left Outer JOIN with Exclusion
A LEFT OUTER JOIN with exclusion is a type of JOIN operation in SQL that combines data from two tables, based on a JOIN condition, and excludes the rows that match the JOIN condition. This type of JOIN is called an outer JOIN with exclusion because it includes the rows from the left (or first) table that do not have a matching row in the right (or second) table, and it excludes the rows from both tables that do have a matching row.
Here is an example of a LEFT OUTER JOIN with exclusion syntax:
SELECT *
FROM table1
LEFT OUTER JOIN table2
ON table1.column1 = table2.column1
WHERE table2.column1 IS NULL
In this example, the LEFT OUTER JOIN combines the rows from table1 and table2, based on the JOIN condition table1.column1 = table2.column1. The WHERE clause then excludes the rows where the table2.column1 column is not NULL, so only the non-matching rows are included in the result.
Want to learn more about join types?
https://SteveStedman.com/joins
More from Stedman Solutions:
Steve and the team at Stedman Solutions are here for all your SQL Server needs.
Contact us today for your free 30 minute consultation..
We are ready to help!
Leave a Reply