统计每门课程的学生选修人数(超过5人的课程才统计)
select c_id, count(s_id) count_sid from Score group by c_id where count_sid >5
where中不能使用聚合函数
更改成:
select c_id, count(s_id) count_sid from Score group by c_id having count_sid >5
统计每门课程的学生选修人数(超过5人的课程才统计)
select c_id, count(s_id) count_sid from Score group by c_id where count_sid >5
where中不能使用聚合函数
更改成:
select c_id, count(s_id) count_sid from Score group by c_id having count_sid >5