select * from t1 where not exists(select 1 from t2 where t1.c1=t2.c1 and t1.c2=t2.c2)

解决方案 »

  1.   

    可以用exists嘛delete from a
     where exists (select 1
              from b
             where a.colname1 = b.colname1
               and a.colname2 = b.colname2)
      

  2.   

    就算你只会用in也能想到select * from t1 where c1||c2 not in (select c1||c2 from t2 )
      

  3.   


    select * from t1 where not exists(select 1 from t2 where t1.c1=t2.c1 and t1.c2=t2.c2)
    你这语句好像不行了  查出来结果不对啊
      

  4.   


    select * from t1 where not exists(select 1 from t2 where t1.c1=t2.c1 and t1.c2=t2.c2)
    你这语句好像不行了  查出来结果不对啊不可能吧
      

  5.   


    select * from t1 where not exists(select 1 from t2 where t1.c1=t2.c1 and t1.c2=t2.c2)
    你这语句好像不行了  查出来结果不对啊
    怎么可能,你举一个测试表,将结果执行出来看看
      

  6.   

    select * from t1 where (t1.c1,tq.c2)not  in (select t1,t2 from t2 )