相关文章  
  • 提升Win XP性能的20个特殊技巧
  • Windows操作系统的十则高级应用技巧
  • 通过 XML 发布新闻
  • Windows 2000操作系统优化实战
  • 制作万能克隆版WinXP超全面攻略
  • 细说Windows XP 虚拟内存优化
  • 戳穿优化Windows XP的经典谣言
  • Windows XP系统全面软优化
  • 再谈如何释放C盘空间 27招具体优化技巧
  • 详解Windows非法操作的具体含义
  •   推荐  
      科普之友首页   专利     科普      动物      植物        天文   考古   前沿科技
     您现在的位置在:  首页 >>文献 >>培训

    了解一下NULLs怎样影响IN和EXISTS4

    gr from emp);
      
      selectename from emp e where exists (select 0 from emp where mgr = e.empno);
      
      不过,当逻辑被转变成使用NOT IN和NOT EXISTS时,问题就出现了,这两个语句会返回不同的行(第一个查询会返回0行;第二个返回意想的数据-它们是不同的查询):
      
      selectename from emp where empno not in (select mgr from emp);
      
      selectename from emp e where not exists (select 0 from emp where mgr =e.empno);
      
      NOT IN子句实际上与用=比较每一个值相同,如果任何一个测试为FALSE 或NULL的话,它就会失败。例如:
      
      select 'true' from dual where 1 not in (null,2);
      
     

    页码:[1] [2] [3] [4] [5] [6]4页、共6页

         

          设为首页       |       加入收藏       |       广告服务       |       友情链接       |       版权申明      

    Copyriht 2007 - 2008 ©  科普之友 All right reserved