delete from a where exists(select 1 from b where a.col=b.col and ...);
delete from b where exists(select 1 from a where a.col=b.col and ...);

解决方案 »

  1.   

    delete from a where exists(select 1 from b where a.col=b.col and ...);这句后A 表已经被删除 相同的了再执行下面的这句还有用吗?
    delete from b where exists(select 1 from a where a.col=b.col and ...);
      

  2.   

    create table tbt as select * from a intersect select * from b;
    delete from a where exists(select 1 from tbt where tbt.col=a.col and ...);
    delete from b where exists(select 1 from tbt where tbt.col=b.col and ...);
    drop table tbt;