将数据去重复后暂存到临时表#temptable中

select distinct * into #temptable from table1 where 条件 

delete table1 where 删除限制条件

insert into table1 select * from #temptable -将暂存的数据插回数据库

drop table #temptable -删除临时表

注:当前的数据库,每一个表都应该有一个标志字段,以保证记录不完全重复,否则实用中极易出问题。

posted on 2021-05-17 18:22  fengwm  阅读(749)  评论(0)    收藏  举报