意思就是把不符合查询结果的删除吧 --比如你是 select * from tb where flag >0 --覆盖原有tb的数据 --你可以直接delete from tb where flag<=0select * from tb --就是你需要的flag>0的数据 --或者入楼上老大说的select * into #temp from tb where flag>0delete * from tbinsert into tb select * from #temp
先生成临时表 select * into #temp from tb 删除原表 drop table tb 插入到新表中 insert into 新表 select * from #temp
--比如你是
select * from tb where flag >0
--覆盖原有tb的数据
--你可以直接delete from tb where flag<=0select * from tb --就是你需要的flag>0的数据
--或者入楼上老大说的select * into #temp from tb where flag>0delete * from tbinsert into tb select * from #temp
select * into #temp from tb
删除原表
drop table tb
插入到新表中
insert into 新表 select * from #temp