Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Count in the field
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01144253
Message ID:
01144254
Vues:
15
Paul,

Try this:
select cycle, count(*) cnt ;
    from mytable ;
    group by cycle
HTH,
Chad


>Hi all,
>
>I have mytable that contained 1 field :
>
>cycle
>
>1 day
>2 days
>3 days
>4 days
>1 day
>2 days
>3 days
>1 day
>2 days
>
>How to select to get the counting of cycle field results like this:
>
>1 day (3 times)
>2 days (3 times)
>3 days (2 times)
>4 days (1 time)
>
>I have tried this but not worked yet :
>
>select sum(iif(cycle = '1 day',cycle,0) as n1day,sum(iif(cycle='2 days',cycle,0) as n2days,sum(iif(cycle='3 days',cycle,0) as n3days,
>sum(iif(cycle='4 days',cycle,0) as n4days from mytable
>
>
>TIA.
_________________________________
There are 2 types of people in the world:
    Those who need closure
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform