SQL Interview: 14: Set operations using EXCEPT
This is a post in the SQL Interview series. These aren’t trick or gotcha questions, they’re just questions designed to scope out a candidate’s knowledge around SQL Server and Azure SQL Database.
Section: Development Level: Medium
Question:
UNION and UNION ALL are commonly used to combine two sets of rows into a single set of rows.
EXCEPT is another set operator.
Can you explain what it does?
Answer:
EXCEPT is used to remove any rows in the first set of rows, if the same rows appear in the second set.
2021-04-29