简介
第二个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