re (null,null) = ANY ((null,null)); select 'true' from dual where (1,null) = ANY ((1,null)); 当你使用一种与EXISTS等同的格式时,SQL会计算行数,却忽视子查询中的值,就算你返回NULL也一样。 select 'true' from dual where exists (select null from dual); select 'true' from dual where exists (select 0 from dual where null is null); 从逻辑上看,IN与EXISTS是一样的。IN子句在外部查询中比较子查询返回的值,并过滤掉行;EXISTS子句在子查询内部比较那些值并过滤掉行。在出现NULL值的情况下,作为结果而出现的那些行是相同的。 selectename from emp where empno in (select m页码:[1] [2] [3] [4] [5] [6] 第3页、共6页 |