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

Click here to load this message in the networking platform