建立索引,使用not exists替代not in。

解决方案 »

  1.   

    oralce效率不低
    select * from tmp_bjctk a where exists(select * from  d_u_bjctk b where a.djbh||a.bjbh||a.zydid||a.swbz= b.djbh||b.bjbh||b.zydid||b.swbz and b.zydid =88888888)
      

  2.   

    oralce效率不低
    select * from tmp_bjctk a where not exists(select * from  d_u_bjctk b where a.djbh||a.bjbh||a.zydid||a.swbz= b.djbh||b.bjbh||b.zydid||b.swbz and b.zydid =88888888)
      

  3.   

    select  *  from  tmp_bjctk  a  where not exists(select  1  from    d_u_bjctk  b  where  a.djbh=b.djbh and a.bjbh=b.bjbh
    and a.zydid=b.zydid and a.swbz=b.swbz  
    and  b.zydid  =88888888)