Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Problem 3 tabelki ->wynik
kyke
post
Post #1





Grupa: Zarejestrowani
Postów: 1
Pomógł: 0
Dołączył: 4.09.2007

Ostrzeżenie: (0%)
-----


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

Ten post edytował kyke 4.09.2007, 15:51:15
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 20.08.2025 - 23:59