Introduction to SQL Server EXCEPT
The SQL Server EXCEPT
compares the result sets of two queries and returns the distinct rows from the first query that are not output by the second query. In other words, the EXCEPT
subtracts the result set of a query from another.
The following shows the syntax of the SQL Server EXCEPT
:
query_1
EXCEPT
query_2
Source: https://www.sqlservertutorial.net/sql-server-basics/sql-server-except/