首页 > 数据库技术 > 详细

Sql Server重复数据删除

时间:2014-12-11 13:51:03      阅读:262      评论:0      收藏:0      [点我收藏+]

--在sql2005下可以 ,sql2000不可以

 create  table tb(id int,name varchar(4))
insert tb select 1,‘aa‘
union all select 1,‘aa‘
union all select 2,‘bb‘
union all select 3,‘bb‘
union all select 4,‘cc‘
union all select 1,‘aa‘
union all select 4,‘cc‘


delete a from 
 (select id,name,rn=row_number() over(partition by id,name order by id) from tb) a where rn>1
select * from tb

原文:http://blog.csdn.net/hzvcan/article/details/4862927

Sql Server重复数据删除

原文:http://www.cnblogs.com/haitao-fan/p/4157406.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!