delete 表A where id not in (select id from 表B)

解决方案 »

  1.   

    delete tableA where id not in (select id from tableB)
    或者用游标也可以
      

  2.   

    或:delete 表A where not exists(select 1 from 表B where id=表A.id)
      

  3.   

    delete 表A where id not in (select id from 表B)
    delete 表A where not exists(select 1 from 表B where id=表A.id)
      

  4.   

    delete 表A where id not in (select distinct id from 表B)
      

  5.   

    delete 表A where id not in (select distinct id from 表B)
      

  6.   

    delete 表A where id not in (select distinct id from 表B)
      

  7.   

    delete A where id not in (select distinct id from B)
      

  8.   

    delete 表A where id not in (select distinct id from 表B)