Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Small .prg slows network
Message
De
14/11/1997 15:38:18
 
 
À
14/11/1997 15:29:19
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00060184
Message ID:
00060332
Vues:
32
>>>>>
>>>>>Larry- I think what you are trying to do can be accomplished with one statement:
>>>>>
>>>>>SELECT count(*), distinct *;
>>>>>FROM masterfile;
>>>>>INTO CURSOR countfile;
>>>>>WHERE inactive <> "Y";
>>>>>GROUP BY agegrp, district
>>>>>
>>>>>This doesn't directly apply to your question, but could possibly reduce the time it takes to create your countfile table.
>>>>
>>>>But the index is agegrp+district. Grouping this way works in the same way as that index would?
>>>
>>>It looks like the only reason to index on agegrp+district is to assure no dupes, and to group the count. A duplicate (in this case) would be defined as two records with the same age group and the same district. Grouping by these values assures that there is only one for each, and serves the same purpose.
>>>
>>>Ken- an ORDER BY clause would work in addition to, but not instead of the GROUP BY.
>>
>>Select distinct cDistrict, cAgeGrp ;
>>From masterfile ;
>>Into cursor tmp ;
>>WHERE inactive <> "Y"
>>
>>nTotal=_TALLY
>
>I thought that he wanted counts for each age group. Maybe I misunderstood...

Maybe you are right. It's because beginning of the thread was cut off. Anyway if you use Group, you shouldn't use Distinct.
Edward Pikman
Independent Consultant
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform