select .. from table1,table2 where table1.xyc not in (select xyc from table2)

解决方案 »

  1.   

    应该是:
    select * from table1 where xyc not in (select xyc from table2)
      

  2.   

    select .. from table1 where table1.xyc not in (select table2.xyc
    from table2);
      

  3.   

    应该这么写:
    select xyc from table1 minus  select xyc from table2 
      

  4.   

    如果表很大,用in、not in速度太慢了,效率低下
    可以用下面的sql:
    select a.* from table1 a ,table2 b 
    where a.xyc =b.xyc(+) 
    and b.xyc is null