There is an important difference in how they handle NULL
s
WITH T1 AS(SELECT 1 AS COL UNION SELECT NULL),
T2 AS (SELECT 2 AS COL UNION SELECT NULL)
SELECT * FROM T1
INTERSECT
SELECT * FROM T2;
.
COL
-----------
NULL
(1 row(s) affected)
.
WITH T1 AS(SELECT 1 AS COL UNION SELECT NULL),
T2 AS (SELECT 2 AS COL UNION SELECT NULL)
SELECT * FROM T1 WHERE COL IN (SELECT COL FROM T2) ;
.
COL
-----------
(0 row(s) affected)
.
WITH T1 AS(SELECT 1 AS COL UNION SELECT NULL),
T2 AS (SELECT 2 AS COL UNION SELECT NULL)
SELECT * FROM T1
EXCEPT
SELECT * FROM T2;
.
COL
-----------
1
(1 row(s) affected)
.
WITH T1 AS(SELECT 1 AS COL UNION SELECT NULL),
T2 AS (SELECT 2 AS COL UNION SELECT NULL)
SELECT * FROM T1 WHERE COL NOT IN (SELECT COL FROM T2);
.
COL
-----------
(0 row(s) affected)