Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
masterdineen
Aged Yak Warrior
550 Posts |
Posted - 2009-11-01 : 18:24:55
|
| HelloI have an orders table with OrderID productID Quantity unitPrice and totalPricethere are many orders of the same ProductID. BUT i want to extract is how much we have made on each Product in one resultcan someone point me in the right direction pleaseRegardsRobMCTS certified |
|
|
russell
Pyro-ma-ni-yak
5072 Posts |
Posted - 2009-11-02 : 00:59:12
|
| [code]SELECT productID, Sum(Quantity * UnitPrice)FROM OrdersGROUP BY productID[/code] |
 |
|
|
masterdineen
Aged Yak Warrior
550 Posts |
Posted - 2009-11-02 : 03:09:53
|
| wow, as easy as thatthank you for you help RussellRegardsRobMCTS certified |
 |
|
|
|
|
|