查询出一个记录集来,怎样删除表中查询出来的记录集以外的记录集?

解决方案 »

  1.   

    delete from tablename where not exists(select * from tablename where 条件...)
      

  2.   

    有主键没,有的话就是
    delete from tablename  a where not exists(select * from tablename b where a.主键=b.主键)
      

  3.   

    delete from tablename  a where not exists(select * from tablename1 b where a.主键=b.主键)
      

  4.   

    为什么要这条语句?
    delete from tablename  a where not exists(select * from tablename b where a.主键=b.主键)
    二楼的不是可以了么?