SELECT studentId'学生id',userName'学生姓名',
sum(score)'学生总分',
count(score)'考试科目数量',
avg(score)'各科目平均分'
from result INNER JOIN student on result.studentId=student.id
GROUP BY studentId,userName
Having AVG(SCORE)>60
order by avg(score) desc;
select * from result INNER JOIN student on result.studentId=student.id;
select * from result left JOIN student on result.studentId=student.id;
select * from result right JOIN student on result.studentId=student.id;
标签:studentId,JOIN,score,查询,左右,result,student,id
From: https://blog.csdn.net/wgh2572701783/article/details/137454863