MySQL用select查找同学平均分

sql中显示各同学的学号和平均分,按平均分降序排列,只统计各科都及格的同学

select * from table where 平均分>60 order by 平均分

select 学号,avg(分数) as 平均分 from table
group by 学号 
having min(分数) > 及格分;
select * FROM (
select 学号,avg(分数) as 平均分 from table
group by 学号 
having min(分数) > 及格分) T1 
ORDER BY 平均分 DESC

select
学号,
avg(分数) as 平均分
from table
group by 学号
having min(分数) > 及格分
order by 平均分 desc