select
a.course,a.name
from student_score a
join (select max(score) max_score, name from student_score group by name) b
on a.name = b.name and a.score = b.max_score;
select a.*
from student_score a
join (select max(score) max_score,course
from student_score
group by course) b
on a.course = b.course and a.score = b.max_score;
表student_score 字段:name, course, score 求 每个人考的最好的一门,每科考的最好的同学
最新推荐文章于 2021-10-12 15:38:20 发布