表名 student
其中有两个字段 sid 和 sname
select sname, count(sid)
from student
group by sname having count(sid)>1;
select sname, count(1) from student group by sname;
select sname from (select sname, count(sname) as cnt from student group by sname having cnt > 1)
select sname, count(1)
from student
group by sname
select sname,count(*) from student group by sname;