首页 > 数据库技术 > 详细

SQL 删除表中重复记录只剩一条

时间:2017-06-23 12:20:32      阅读:201      评论:0      收藏:0      [点我收藏+]

 

今天不小心插入数据时插入重复了

这表中没有任何主键外键,随便插入或删除

网上查了很多复杂的语句都没有解决问题

最后用delete top (1) 解决问题

delete top (1) from Persion where name = xiaomin


也可以用

update  top (1) from person where name =‘xxxx‘

delete from person where name = ‘xxxx‘

 

没那么复杂

 

SQL 删除表中重复记录只剩一条

原文:http://www.cnblogs.com/goldenyi/p/7069114.html

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