Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select-sql statement
Message
 
To
01/02/2002 15:34:03
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00614246
Message ID:
00614274
Views:
25
>>>Hi All,
>>> Is there a way to craft a select statement to list what is in a field and how many times what is in the field repeat?
>>>Thanks,
>>
SELECT field1, COUNT(*) FROM mytable GROUP BY 1
>
>Thanks Sergey, you are the greatest.

Note, that starting with VFP3, COUNT(myField) tells you the number of records in your group with a non-NULL value for myField, while COUNT(*) will bring the number of records in the group. YMMV.
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform