i have a problem with my SQL query. When I use more then one JOIN, the result is wrong.
SELECT name, stock,SUM(order_items.qty),
SUM(shipping_items.qty) FROM shipping_items
JOIN mnm_products
ON mnm_products.id = shipping_items.product_id
JOIN order_items
ON mnm_products.id = order_items.product_id
GROUP BY mnm_products.id
When i use only
SELECT name, stock,
SUM(shipping_items.qty) FROM shipping_items
JOIN mnm_products
ON mnm_products.id = shipping_items.product_id
GROUP BY mnm_products.id
it´s right. But when i use 2 joins. the result of both are the same. Can anybody help me there?