Most likely, you have several NULL values ββin the key column. NULL comparisons always return null, which evaluates to false. This may be the opposite of the intuitive. for example
SELECT * FROM MyTable WHERE SomeValue <> 0
Do not return values ββusing SomeValue = NULL. Although intuitive, NULL is not zero. Therefore, to correct the request, you must do the following.
select * from table1 where date >= "2012-01-01" and (key not in (select some_key from table2) OR key IS NULL);
Kibbee
source share