Proszę o pomoc :
Mam 3 tabelki:
Tabela: User ( User_id, User_name, User_adress, ....)
Tabela: Orders ( User_id, Order_id, ...... )
Tabela: Orders_item ( Order_id, Order_item_name, Product_quantity, ….)
SELECT
order_item.order_item_name, sum(order_item.Product_quantity), user.User_name, user.User_adress
FROM
order_item LEFT JOIN orders ON order_item.order_id=orders.order_id
LEFT JOIN user ON orders.user_id=user.user_id
WHERE order_item.order_item_sku <30
GROUP BY order_item.order_item_name;
Proszę pomóżcie bo chcę otrzymać wynik, jestem kiepski w sql-u:
------------------------- Oreder_item_name---------Order_item_name2--------Order_item_name..-------|
User_name1, User_adress-Sum of Product_quantity---Sum of Product_quantity--Sum of Product_quantity
User_name1, User_adress-Sum of Product_quantity---Sum of Product_quantity--Sum of Product_quantity