Take these two simple statements:
SELECT '1 IS NOT IN THE LIST' WHERE 1 NOT IN (2, 3, 4)
SELECT '1 IS NOT IN THE LIST' WHERE 1 NOT IN (NULL, 2, 3, 4)
The results you will get are:
Basically, as soon as you add NULL to the list, the NOT IN condition always returns FALSE, implying that (in this case) 1 = NULL
Can someone explain why this happens?
Following on from that, why does this statement (the opposite of the NOT IN that returned FALSE) not return TRUE?
SELECT '1 IS IN THE LIST' WHERE 1 IN (NULL, 2, 3, 4)