EXCEPT & INTERSECT keywords
Returns distinct rows by comparing the results of two queries.
#
SyntaxEXCEPT
returns distinct rows from the left input query that aren't output by the right input query.INTERSECT
returns rows that are returned by both input queries.
#
ExamplesThe below examples use long_sequence(n) to generate a list of integers from 1 to n.
#
EXCEPTReturns rows unique to the left query. In this case, integers from 6 to 10
#
INTERSECTReturns rows output by both queries. In this case, integers from 1 to 5