嵌套在SQL中的联接3表 [英] nested join 3 table in sql
本文介绍了嵌套在SQL中的联接3表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨朋友
我有3张桌子
表1:ID_1(主键),ID_2(外键),ID_3(外键)
表2:ID_2(主键),名称
表3:ID_3(主键),名称
我想加入3张桌子并获得1张桌子
请引导我.
hi friends
I have 3 table
table 1 : ID_1 (Primary Key) , ID_2 (Foreign Key) , ID_3 (Foreign Key)
table 2 : ID_2 (Primary Key) , Name
table 3 : ID_3 (Primary Key) , Name
I want join 3 table and get 1 table
please Guide me .
推荐答案
select * from table1 INNER JOIN table2 ON table1.ID_2 = table2.ID_2
INNER JOIN table2 ON table1.ID_3 = table3.ID_#
这篇关于嵌套在SQL中的联接3表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文