1.查询单列重复
select * from table where name in (select name from table group by name having count(name) > 1)
2.查询多列重复
SELECT a.* FROM table a,( SELECT name,code FROM table GROUP BY name,code HAVING COUNT(1)>1) AS b WHERE a.name=b.name AND a.code=b.code
标签:code,name,重复,查询,SQL,table,Server From: https://www.cnblogs.com/microsoft-zh/p/17513404.html