Forum Moderators: coopster
Ive been fiddling around with a mysql query but cant get the result i want.
Say i have the following table "orders":
OrderID OrderName OrderQty
1 apple 4
2 oranges 2
3 grapes 2
4 peaches 2
5 apple 6
6 peaches 3
7 bananna 2
I want to return the data like so:
apple 10
peaches 5
bananna 2
grapes 2
oranges 2
Any help greatly appreciated
cheers
"SELECT OrderName,OrderQty FROM orders ORDER BY OrderQty DESC;"
will produce the result:
apple 6
apple 4
peaches 3
bananna 2
grapes 2
oranges 2
peaches 2
whereas im tyring to combine identical entries to get:
apple 10
peaches 5
bananna 2
grapes 2
oranges 2
cheers