kevin3e

导航

sqlserver删除临时表中的数据

select distinct * into #tmptable from tablename
drop table tablename
select * into tablename from #tmptable
drop #tmptable

思路:把表中重复的数据祛重之后放入临时表中,第二步删掉表中原有的数据,接着把临时表中的数据放入原表中,最后删掉临时表

posted on 2017-11-29 19:58  kevin3e  阅读(2341)  评论(0编辑  收藏  举报