Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/63.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mysql 基于一个列名连接三个不同的表_Mysql - Fatal编程技术网

Mysql 基于一个列名连接三个不同的表

Mysql 基于一个列名连接三个不同的表,mysql,Mysql,最终产量 table A amount user_id 100 abc 200 cdf 300 def table B Idno user_id 10 abc 202 def table C Idno user_id 498 cdf 我知道把两张桌子连在一起 Idno user_id amount 10 abc 100 202 def 200 498

最终产量

table A
amount user_id
100     abc
200     cdf
300     def

table B
Idno    user_id
10        abc
202       def

table C
Idno    user_id
498      cdf
我知道把两张桌子连在一起

Idno    user_id     amount
10        abc       100
202       def       200
498       cdf       300
但我的问题是,如何在两个表中显示最终输出所示的所有用户id量

这是您想要的吗

table A
amount user_id
100     abc
200     cdf
300     def

table B
Idno    user_id
10        abc
202       def

table C
Idno    user_id
498      cdf
select A.amount,B.Idno,B.user_id from B inner join A on A.user_id=B.user_id;

从他的表格来看,我认为这应该是正确的答案。表C和表B的结构相同吗?只维护一个表,一个是存储,另一个是存储shoppe@MostyMostacho我已经接受了所有的答案……但我没有得到答案,我没有接受:)