Answer the question
In order to leave comments, you need to log in
How to correctly compose an SQL query (JOIN)?
There are 3 tables:
1) Main table with orders
2) Connecting table
3) Main table with goods
I fight with JOINs, it doesn't work. How to draw columns: product name (from 3 tables), quantity (1 table), cost (1 table)?
Answer the question
In order to leave comments, you need to log in
SELECT
a.price,
a.count,
c.name
FROM
a
LEFT JOIN b ON a.id_order = b.id_order
LEFT JOIN c ON b.id_product = c.id_product
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question