What is the difference between intersect and except in sql server?

All topics about programming / development in T-SQL or other languages for SQL Server.
Post Reply
cascade
Posts: 5
Joined: Tue Jul 02, 2019 7:37 pm

Thu Jul 11, 2019 5:12 pm

As the title states, could anybody tell me the difference between intersect and except in sql server?
JayLAr
Posts: 1
Joined: Thu Jul 11, 2019 3:45 pm

Thu Jul 11, 2019 5:23 pm

The Except and Intersect operators return distinct rows by comparing the results of two queries.

EXCEPT returns distinct rows from the left input query that aren't output by the right input query.

INTERSECT returns distinct rows that are output by both the left and right input queries operator.
Post Reply

Social Media