简介
第二个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;
2023-10-08 22:11:04
第二个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;
下一篇:指针练习题