-- 查询两门及其以上不及格课程的同学的学号,姓名及其平均成绩
select student_no,name,avg_score
from
(select a.student_no,name
,avg(score) avg_score
,sum(case when score<60 then 1 else 0 end) score60_num
from score a
inner join student b
on a.student_no=b.student_no
group by student_no having score60_num>=2) a
sql查询两门及其以上不及格课程的同学的学号,姓名及其平均成绩
最新推荐文章于 2022-09-16 15:41:00 发布