Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Count() in SQL??
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00128117
Message ID:
00130833
Views:
25
>You can get what you want with one SELECT.
>
>SELECT s_or_status, COUNT(*) FROM TableName GROUP BY s_or_status INTO CURSOR Result
>
>Result will have one record for each Status value with the count of records that had that value.

Just a caution when using COUNT(*): This will count records with NULLs! If you COUNT(), it won't count the field if its value is NULL.
Previous
Reply
Map
View

Click here to load this message in the networking platform