I've got a weird question. I have three tables: - table_a with columns (id, product_id, customer_id, location, phone) - table_b with columns (id, product_id, product_name) - table_c with columns (id, customer_id, customer_name)
What I would like to display is a table with following content: table_a.id, product_name, customer_name, location, phone
So I assume somehow I should use left join table_b, table_c with table_a.
I've tried multiple approaches like:
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
I want to avoid making duplicates of product_id/customer_id in final table..