Hi!
I'm new to DB2 and has a query that I just can't get right
I have four tables:
From this I would like to build a query thats lists all users that has a balance thats <> 0 and then calculate total ordersum for the open orders. To end it all I would like to present the biggest and smallest size in the order.
In other words I would like this result:
I'm new to DB2 and has a query that I just can't get right
I have four tables:
Quote:
t.Users ID | Name 1 | Eric 2 | Hans 3 | Eve t.Balance userID | orderID| Payment 1 | 100 | 1000 2 | 200 | 100 2 | 200 |-100 1 | 100 | -50 t.Order Userid | orderID | Sum 1 | 100 | 1000 1 | 100 | 2000 t.OrderDetails orderID | ProductID | Size 100 | 11 | 20 100 | 12 | 15 100 | 13 | 10 |
In other words I would like this result:
Quote:
Name | OrderID | Balance | Ordersum | Smallest size | Biggest size Eric | 100 | 950 | 3000 | 10 | 20 |