将数据去重复后暂存到临时表#temptable中
select distinct * into #temptable from table1 where 条件
delete table1 where 删除限制条件
insert into table1 select * from #temptable -将暂存的数据插回数据库
drop table #temptable -删除临时表
注:当前的数据库,每一个表都应该有一个标志字段,以保证记录不完全重复,否则实用中极易出问题。
将数据去重复后暂存到临时表#temptable中
select distinct * into #temptable from table1 where 条件
delete table1 where 删除限制条件
insert into table1 select * from #temptable -将暂存的数据插回数据库
drop table #temptable -删除临时表
注:当前的数据库,每一个表都应该有一个标志字段,以保证记录不完全重复,否则实用中极易出问题。
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。