码迷,mamicode.com
首页 > 数据库 > 详细

sql查询重复数据

时间:2016-07-29 18:52:57      阅读:217      评论:0      收藏:0      [点我收藏+]

标签:

select *
from A
where id in (select id from A group by id having count(1) >= 2)

注释:id 为重复的关键字(更换成所需要的)

开发实例:

select CarlotName ,CheweiID
from Position_Car a
where a.CarlotName in (select CarlotName from Position_Car b group by b.CarlotName having count(1) >= 2)

sql查询重复数据

标签:

原文地址:http://www.cnblogs.com/tuhong/p/5719125.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!