Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select Statement
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Select Statement
Miscellaneous
Thread ID:
00809334
Message ID:
00809334
Views:
63
Everybody,
I was wondering this is possible using a Select statement. I am using VFP 7.0. I want to add an Order column to the following Select statement. What I want in the Order column is the ranking of the record.

SELECT Pareto.Commodity, Pareto.Test_Code, ;
SUM(Pareto.TtlQty) AS SumTtlQty ;
FROM Pareto;
GROUP BY Pareto.Commodity, Pareto. Test_Code ;
ORDER BY Pareto.Commodity, SumTtlQty DESC, ;
Pareto.Test_Code

Returned Result
Commodity Test_Code SumTtlQty Order
Monitor 3501-204 13329 1
Monitor 0FUN-017 7405 2
Monitor WKS08 4919 3
Monitor 3501-203 3575 4
Monitor 3501-202 3032 5
Monitor 0FUN-018 2814 6
Monitor 0FUN-023 2426 7
Monitor 3501-218 1071 8
Monitor 3501-219 716 9
Monitor 3501-213 598 10
Motherboard WKS20 74505 1
Motherboard 0FUN-017 9712 2
Motherboard WKS12 2422 3
Motherboard 0FUN-018 2202 4
Motherboard 0FUN-016 1899 5
Next
Reply
Map
View

Click here to load this message in the networking platform