databasessql
Why NOT IN behaves differently when NULL is present
Anonymous
In SQL, NOT IN can behave unexpectedly when the list contains NULL: a nonmatching value compared against NULL is unknown, not true, so WHERE filters it out. When nulls may appear, NOT EXISTS with a matching condition often expresses the intended anti-join more clearly. Check how nulls should behave before choosing between them.
0