using the NOT IN operator on a column with null values


I have a table employee which has a column company which has all null values

Now, I want to use a NOT IN operator for the company name as

select * from employee where NOT IN ('ABC', 'DEF')

Now technically this should not alter the result since the company column already had null values.

But adding the NOT IN gives 0 rows.

Is this due to the fact that column has NULL values?

Try this way:

select *
from employee E
where ( NOT IN ('ABC', 'DEF')
       or is null)