PHP之路——Mysql多表查询

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

  

 

posted @ 2016-07-16 22:54  偏执Dog  阅读(4851)  评论(0编辑  收藏  举报