Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Fastest way for sum records
Message
De
07/12/2008 07:49:32
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
07/12/2008 02:15:19
Reza Meamar
Homa Programming Group
Shiraz, Iran
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Divers
Thread ID:
01365809
Message ID:
01365818
Vues:
19
>Hi all,
>I have a table with at least 200000 records in it.
>IdField and Payment are its fields.
>What is the fastest way to getting sum of payment for some records?
>Is SUM command suitable for this?
>SUM Payment ALL FOR IdField=2134 TO SumPayment

You can use SUM as you showed, or a SELECT ... SQL. Visual FoxPro still has to process all the records that meet the criteria; the key to speed is to have an index that matches the expression. In this case, an index on ldField.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform