General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only