【发布时间】:2016-07-02 18:23:35
【问题描述】:
我有一个奇怪的问题。我有三张桌子: - 带有列(id、product_id、customer_id、位置、电话)的 table_a - 带有列的 table_b(id、product_id、product_name) - 带有列(id、customer_id、customer_name)的 table_c
我想显示的是一个包含以下内容的表格: table_a.id、product_name、customer_name、位置、电话
所以我假设我应该以某种方式使用左连接 table_b、table_c 和 table_a。
我尝试了多种方法,例如:
SELECT*FROM table_a INNER JOIN table_b, table_c
ON table_a.product_id = table_b.product_id
ON table_a.customer_id = table_c.customer_id
我想避免在决赛桌中重复 product_id/customer_id..
【问题讨论】: