select studentId '学号',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;
俩个表联合查询
最新推荐文章于 2024-08-15 18:19:19 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)