爲什麼下面的查詢沒有返回你好?
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