为什么下面的查询没有返回你好?
select 'hello' where 'a' not in ('b', null)
为什么下面的查询没有返回你好?
select 'hello' where 'a' not in ('b', null)
简短的答案是你不能有一个空值。
SELECT 'hello' WHERE 'a' <> 'b' AND 'a' <> NULL;
第一个条件计算结果为true:
参考http://stackoverflow.com/questions/296146/sql-query-question-select-not-in – Salil 2010-06-25 06:03:29