其他分享
首页 > 其他分享> > 考试分数(二)

考试分数(二)

作者:互联网

简介

第二个select一定要起一个别名,否则会出错
注意子查询

select a.id, a.job, a.score from
grade as a
left join
(
    select job, avg(c.score) as score from
    grade as c
    group by c.job
) as b
on a.job = b.job
where a.score > b.score;

标签:考试分数,grade,job,score,avg,select
来源: https://www.cnblogs.com/eat-too-much/p/14959143.html