select a.id,a.`name` AS '姓名',b.`subject`,c.`achievement`
from aaa AS a left join ccc AS c on a.id=c.uid
left join bbb AS b on c.sid=b.id
where a.id in(1,2,3)
group by c.achievement
having c.achievement>=60
order by c.achievement desc
limit 3
select a.id,a.`name` AS '姓名',b.`subject`,c.`achievement`
from aaa AS a left join ccc AS c on a.id=c.uid
left join bbb AS b on c.sid=b.id
where a.id in(1,2,3)
group by c.achievement
having c.achievement>=60
order by c.achievement desc
limit 3
转载于:https://www.cnblogs.com/xj76149095/p/5677451.html