delete from a where exists(select 1 from b where a.code=b.code)

解决方案 »

  1.   

    delete * from a where exists(select * from b where code=a.code);
      

  2.   


    这个写法不错:
    delete * from a where exists(select * from b where code=a.code);
      

  3.   

    delete a where exists(select null from b where b.code=a.code and b.name=a.name);
      

  4.   

    删除前最好先备份
    delete from a where code||name in (select distinct code||name from b);
      

  5.   

    delete from a where rowid in(select a.rowid from a,b where a.code=b.code)
      

  6.   

    delete * from a where exists (select * from b where code = a.code);
      

  7.   

    delete table a where code in (select a.code from a,b where a.code = b.code);
      

  8.   

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

  9.   

    delete from A where exists(select * from B where A.code=B.code and A.name=B.name)
      

  10.   

    delete from a where exists(select 1 from b where a.code=b.code)
      

  11.   

    delete from A where exit(select * from B where A.code=B.code)
    如果要全部相同的存在,则要:
    delete from A where exit(select * from B where A.code=B.code and A.name=B.name)
      

  12.   

    真是烂人,这么多人给了各种写法,居然一分都不给。
    我给你一个最简单的写法吧:delete * from a where code<>'0'