我有一个问题,那时没有线索或起点如何解决:
我有三个包含以下字段的表(我只限于重要字段):
table1 table2 table3
idsp idsp did
customer did
我需要的是table1和table3的大部分字段,table1通过字段idsp合并到table2, 表 2 和表 3 在字段上。
正如我所说,我没有起点...有人帮忙吗?
谢谢, 萨沙
最佳答案
select t1.*, t3.* from
table1 t1
inner join table2 t2
on t1.idsp = t2.idsp
inner join table3 t3
on t2.did = t3.did
继续一个接一个地使用连接。
关于MySQL 加入 3 个表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5461269/