select 'true' from dual where 1 != null and 1 != 2; select 'true' from dual where (1,2) not in ((2,3),(2,null)); select 'true' from dual where (1,null) not in ((1,2),(2,3)); 这些查询不会返回任何行。而第二个更值得怀疑,1!=NULL是NULL,因此对整个WHERE条件来说都是错误的。它们会这样运行: select 'true' from dual where 1 not in (2,3); select 'true' from dual where 1 != 2 and 1 != 3; 只要你在结果中阻止系统返回NULL,在这之前你还是可以使用NOT IN查询(同样,这些都能运行,不过我假定empno不是NULL,在我们这个案例中,这是一个很好的假设): s页码:[1] [2] [3] [4] [5] [6] 第5页、共6页 |