Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Calculating the mode
Message
De
27/06/2001 23:38:07
Gavin Reid
L & M Marketing Pty Ltd
Frenchs Forest, Australie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00524498
Message ID:
00524500
Vues:
32
Hi Chris,

How about:
SELECT mynumber, COUNT(*) AS modecount ;
    FROM mytable ;
    GROUP BY 1 ;
    ORDER BY 2 DESC ;
    INTO CURSOR mycursor
The first record in the cursor will contain the most common number.

Hope this helps,
Gavin...

>Hi All
>
>We need to calculate the mode (most commonly occurring number) from a list of values - excel can do it with the MODE() function - does anyone know if VFP can do something similar?
>
>Cheers
>
>Chris Kable
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform