Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select Statement
Message
De
11/07/2003 15:40:04
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00809334
Message ID:
00809371
Vues:
32
I can't think of a way using SELECT, either. Putting into a readwrite cursor is probably the easiest, then scan through and populate that field.

But if you only need this cursor for a report, you can use a calculated field in the VFP report writer to do this for you.

>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
Steve Gibson
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform