显示table1的所有记录,除了A包含2以及B包含5
Table1
------
A B
-
8 5
2 9
null 4
2 5
select * from table1 where a not in 2 and b not in 5;
它不起作用,它将显示为0行选择
答案 0 :(得分:3)
试试这个:
SELECT * FROM Table1
WHERE (a is null or a != 2) and (b is null or b != 5)
修改强>