WITH a AS ( SELECT 1 id
UNION
SELECT 2
),
b AS ( SELECT 1 id
SELECT 3
)
SELECT *
FROM a
EXCEPT
FROM b;
INTERSECT
FROM b