Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to Accumulate field in SQL
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00333469
Message ID:
00333489
Vues:
11
>Hi.
>
>Anybody know of a way, in one pass, to accumulate a field with SQL code. I would like to do something like:
>Select Myfield,Cum(Myfield) as MyCum from myfile into cursor Mycursor
>To give following result:
>
>Myfield Mycum
>1 1
>3 4
>2 6
>8 14
>6 20 etc...
>
>regards,
>Gerard

Try doing your select with the COUNT() function to get the numbers of rows, or the SUM() function to get the total amounts of the data in the fields...

SELECT SUM(myfield), myfield GROUP BY myfield

HTH
Wayne Myers, MCSD
Senior Consultant
Forte' Incorporated
"The only things you can take to heaven are those which you give away" Author Unknown
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform