gpt4 book ai didi

MySQL 加入 3 个表

转载 作者:太空宇宙 更新时间:2023-11-03 10:26:00 24 4
gpt4 key购买 nike

我有一个问题,那时没有线索或起点如何解决:

我有三个包含以下字段的表(我只限于重要字段):

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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com