查询出一个记录集来,怎样删除表中除了查询出来的记录集以外的记录集? 查询出一个记录集来,怎样删除表中查询出来的记录集以外的记录集? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 delete from tablename where not exists(select * from tablename where 条件...) 有主键没,有的话就是delete from tablename a where not exists(select * from tablename b where a.主键=b.主键) delete from tablename a where not exists(select * from tablename1 b where a.主键=b.主键) 为什么要这条语句?delete from tablename a where not exists(select * from tablename b where a.主键=b.主键)二楼的不是可以了么? 我发个字符截取的帖子, 千元求数据库检索速度加快方法 怎么将SQL2005命名实例改为默认实例啊 求一语句,和工作日相关的 帮我看看着语句里的东西 大家看看 我的事务哪里不正确! 向明白人求教一个SQL查询语句 很深奥的后台程序员! 开仓放粮。怎么把一个数据库中的各个表的结构导出成excel文件。 苦恼! SQL server2K的sp3补丁好象问题很大! 求一SQL语句 delete 如何删除串表的数据?
delete from tablename a where not exists(select * from tablename b where a.主键=b.主键)
delete from tablename a where not exists(select * from tablename b where a.主键=b.主键)
二楼的不是可以了么?