sql查询重复数据

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)

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