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

解决方案 »

  1.   

    或直接查询:
    Select * from A表 a
    left join B表 b on a.a = b.a and a.b = b.b
    where b.a is null and b.b is null
      

  2.   

    select a.* from a
    left join b on a.a=b.a and a.b=b.b
    where b.a is null and b.b is null
      

  3.   

    或:
    select * from a where not exists(select 1 from b where a.a=b.a and a.b=b.b)
      

  4.   

    Select a.* from A表 a
    left join B表 b on a.a = b.a and a.b = b.b
    where b.a is null and b.b is null
      

  5.   

    delete a from A表 a,B表 b where  a.a = b.a and a.b = b.b
      

  6.   


    select a.* from A where convert(varchar, a) + ' ' +
    convert(varchar, b) not in (select convert(varchar, a)
    + ' ' + convert( varchar, b) from b)
      

  7.   

    select a.* from a
    left outer join b on a.a=b.a and a.b=b.b
    where b.a is null and b.b is null
      

  8.   

    Select a.* from A表 a
    left join B表 b on a.a = b.a and a.b = b.b
    where b.a is null and b.b is null
      

  9.   

    select * from a where a not in(select a.a from a inner join b on a.a=b.a and a.b=b.b) and b not in (select a.a from a inner join b on a.a=b.a and a.b=b.b)
      

  10.   

    刚才发错了
    select * from a where a not in(select a.a from a inner join b on a.a=b.a and a.b=b.b) and b not in (select a.b from b inner join b on a.a=b.a and a.b=b.b)
      

  11.   

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

  12.   

    select * from A表 where (A表.a<>B表.a and A表.b<>B表.B)