Consider the following query (tested on PostgreSQL – some other systems may require a table to be specified):

SELECT 'Yes' AS Value_Returned
WHERE 1 != 2;

This query returns 1 row: ( Value_Returned = 'Yes' ), as one would expect. But what if we compare against NULL?

SELECT 'Yes' AS Value_Returned
WHERE 1 != NULL;

0 rows returned, even though 1 is not NULL. This is because of the way logic works for NULLs; <anything> != NULL and <anything> = NULL always return UNKNOWN, which is not TRUE. UNKNOWN AND TRUE equals UNKNOWN, and UNKNOWN AND FALSE equals FALSE.

Similarly, any NOT IN operation using a set containing NULL will never return TRUE. For example:

SELECT 'Yes' as Value_Returned
WHERE 2 NOT IN (1, NULL);

does not return any rows.