立即学习:https://edu.csdn.net/course/play/4364/77160?utm_source=blogtoedu
# 获取平均分最高的前两名学生的姓名和平均分
create PROCEDURE getmax()
begin
select a.Sname 姓名, AVG(b.mark) 平均分
from TStudent a join TScore b on a.StudentID = b.StudentID
group by b.StudentID
order by AVG(b.mark) desc limit 2
end
call getmax()