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

sql select 嵌套

时间:2016-05-27 18:40:36      阅读:331      评论:0      收藏:0      [点我收藏+]

标签:select 嵌套

select * from (select XXX from XXX) as a inner join(select xxxx from xx) as b where a.xx=b.xx


select * from (select id,pid,khdm,khmc from com_base_kehu where khdm2=‘DHB003‘)as a left join (select a.id as 序号,a.org_id,a.yhzdmc,b.pid,b.id,b.zd_id,c.khmc from ipos_yhzdz a inner JOIN ipos_yhzdzmx b on a.id=b.pid INNER JOIN com_base_kehu c on b.zd_id=c.Id where a.org_id=‘3386‘  ) as b on a.Id=b.zd_id 


本文出自 “marsng” 博客,请务必保留此出处http://marsng.blog.51cto.com/2693748/1783881

sql select 嵌套

标签:select 嵌套

原文地址:http://marsng.blog.51cto.com/2693748/1783881

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