Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Count in the field
Message
 
To
09/08/2006 14:19:42
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01144253
Message ID:
01144254
Views:
10
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform