mysql 超过5名学生的课

select class
from
(
select distinct student, class
from courses 
) t
group by class 
having count(class)>=5

脚本如下:

select class
from
(
select distinct student, class
from courses 
) t
group by class 
having count(class)>=5

注意 可能有重复记录

相关推荐