从3个表中检索数据,每个表在另一个第4个表中具有索引 [英] retrive data from 3 tables each having index in another 4th table

查看:63
本文介绍了从3个表中检索数据,每个表在另一个第4个表中具有索引的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有3张桌子

t1(身份证,姓名)

t2(身份证,姓名)

t3(身份证,姓名)< br $>


和另一张表

指数(t1id,t2id,t3id)

i需要上述3个表中的两个名字。 ...那个连接查询是什么???



感谢问候!!

i have 3 tables
t1(id,name)
t2(id,name)
t3(id,name)

and another table
Index(t1id,t2id,t3id)
i want both names in above 3 tables.... what is the join query for that???

thanks regards!!

推荐答案





试试这个查询..







try this query..


Select t1.Name,t2.Name,t3.Name from Table4 t4
Inner join Table1 t1 on t1.id=t4.id1
Inner join Table2 t2 on t2.id=t4.id2
Inner join Table3 t3 on t3.id=t4.id3






它可以帮到你..





问候,
Prakash.T




it may help you..


regards,
Prakash.T


从t1,t2,t3,t4选择t1.name,t2.name,t3.name

其中t1。 id = t4.t1id和t2.id = t4.t2id和t3.id = t4.t3id
select t1.name,t2.name,t3.name from t1,t2,t3,t4
where t1.id=t4.t1id and t2.id=t4.t2id and t3.id=t4.t3id


这篇关于从3个表中检索数据,每个表在另一个第4个表中具有索引的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆