码迷,mamicode.com
首页 > 其他好文 > 详细

inner join 多表查询

时间:2017-09-22 22:29:09      阅读:170      评论:0      收藏:0      [点我收藏+]

标签:UI   blog   举例   sel   guid   联合   java   联合查询   inner   

三表以及三表以上联合查询:

select table1.ziduan1,table2.ziduan,2,table3,ziduan3
from table1 inner join table2 
on table1.field1 = table2.field1 
inner join table3 
on table1.field1 = table3.field1

 举例: 

select clFile.FILEPATH,clPerson.personcode,cailiao.clcode 
    from clFile inner join clPerson 
    on clFile.PGUID = clPerson.MGUID
    inner join cailiao 
    on clPerson.MGUID = cailiao.clGuid";

俩表联合查询:

select * FROM 
    表1 INNER JOIN 表2 
    ON 表1.字段号=表2.字段号

 举例:

select * from CaiLiao inner 
    join clCode 
    on CaiLiao.clCode=clCode.code 
    where CaiLiao.clGUID 
    in (select mGUID from clPerson where pcode = ‘123‘ )                  

  

inner join 多表查询

标签:UI   blog   举例   sel   guid   联合   java   联合查询   inner   

原文地址:http://www.cnblogs.com/Sophias/p/7577226.html

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