select 姓名列,count(1) as [重复次数] from 表名 group by 姓名列 having count(1)>=2 order by 重复次数 desc
这样试试
select t1.*
from test t1 left join
(select name,count(name) c
from test
group by name) t2 on t1.name=t2.name
where c>1
order by c desc
select name ,fcount from
(select name,count(name) as fcount from table group by name) t
order by fcout desc