Answer the question
In order to leave comments, you need to log in
How to form a many to many SQL query?
Help to form a many to many query: you need to get the name of the product, the quantity and amount of the order (cheque table).
There are 3 tables:
Answer the question
In order to leave comments, you need to log in
So far I've found this solution:
SELECT
p.name,
c.count_product,
p.price,
s.sum_sale,
s.date
FROM
product AS p
INNER JOIN cheque AS c
ON
p.id = c.id_product
INNER JOIN sale AS s
ON
s.id = c.id_sale
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question