By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
SELECT 1 AS PK, 21 AS c, NULL AS b
INTO tab1;
SELECT 1 AS PK, 21 AS c, 2 AS b
INTO tab2;
2 rows affected
SELECT *
FROM tab1 A
JOIN tab2 B ON A.PK = B.PK
WHERE EXISTS(SELECT A.c, A.B
EXCEPT
SELECT B.c, B.b);
PK | c | b | PK | c | b |
---|---|---|---|---|---|
1 | 21 | null | 1 | 21 | 2 |