有表A,B
 先查询到select a,b from A;
要删除表B中B.a=a and B.b=b的

解决方案 »

  1.   

    delete from B where B.a in (select a from A) and b in (select b from A)
      

  2.   

    这样会删多了的吧,我要删的是对应的B.a=A.a and B.b=A.b的
      

  3.   

    zhao_tk写得应该行,B.a in (select a from A)的效果类似于B.a=A.a,
    B.a={a,b,c},A.a(a,b,c,d,e,f...),in 的效果应该会选择出a=a,b=b,c=c的结果集吧!
      

  4.   

    试试这个:
    delete B
    where exists(select a,b from A where B.a = A.a and B.b = A.b)
      

  5.   

    是这样吗?你能确定吗,我怎么觉得他那样写a=a,b=a的也会删掉啊
      

  6.   

    delete from B 
    join A
    on B.a=A.a and B.b=A.b