给一个班级成绩表 student (name,subject,score) ,
查询出所有总分数>600分的学员
select name,sum(score) from student group by name having sum(score)>600;
在总分大于600的基础上,去掉不及格的学员并按总分倒序排列。
select name,sum(score) s from student group by name having sum(score)>600 and min(score)>60 order by s desc;
找出有三科挂了的学员
select name from student where score<60 group by name having count(name)>=3;