Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Counting field values in a table....
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00345652
Message ID:
00345928
Views:
9
>I need to count the number of occurrences of certain field values...
>
>i.e.
>
>field ... color
>
>I need to get a count of records with values red, green, blue, etc.
>
>then a total of all records...
>
>I found a cube function which works with sql server but foxpro doesn't seem to like it...
>
>Is there another way to do this in foxpro...
>
>Thanks,
>
>Dennis

select sum(iif(color='red',1,0)) as red, sum(iif(color='green',1,0)) as green, coun(*) as allcolors from therainbow
Doru
Previous
Reply
Map
View

Click here to load this message in the networking platform