EXISTS里的子查询结果集非空,EXISTS()子句的值就是true。 
EXISTS里的子查询结果集为空,EXISTS()子句的值就是false。 

NOT EXISTS里的子查询结果为非空,NOT EXISTS()字句的值是false

NOT EXISTS里的子查询结果为为空,NOT EXISTS()字句的值是true

 

例如:

select * from emp where not exists (select * from emp a where a.empno = 1131001 );

能查到结果集

select * from emp where exists (select * from emp a where a.empno = 11001 );

能查到结果集 

结论 not exitst 子句为空 能查询到结果集 等价于 exist  子句非空

 

 

 

 

 

 

转自:http://yangzhonglei.iteye.com/blog/699673 

感谢分享

相关文章:

  • 2021-09-17
  • 2021-06-21
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-10-02
  • 2021-11-23
  • 2021-09-05
  • 2022-12-23
  • 2022-01-10
  • 2021-07-13
相关资源
相似解决方案