码迷,mamicode.com
首页 > 数据库 > 详细

PHP之路——Mysql多表查询

时间:2016-07-17 12:11:32      阅读:217      评论:0      收藏:0      [点我收藏+]

标签:

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

  技术分享

 

PHP之路——Mysql多表查询

标签:

原文地址:http://www.cnblogs.com/xj76149095/p/5677451.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!