SQL语句查询成绩低于该门课程的平均分的学生的学号

查询成绩低于该门课程的平均分的学生的学号

select Score.courseNo,Score.studentNo 
from (select avg(Score.score) as avgScore,courseNo
	  from Score
      group by courseNo
      ) a
left join Score on a.courseNo = Score.courseNo
where score < avgScore
group by Score.courseNo,Score.studentNo

原创文章 7 获赞 8 访问量 1163

猜你喜欢

转载自blog.csdn.net/bestlinton/article/details/105901061