Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Count the records
Message
 
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01310624
Message ID:
01310674
Views:
13
>in my filed (category) records as=A,B,C,A,A,A
>I want to count the records.
>if A,A,A is replaced continuously
>SELECT date,code,lcode,sec, ;
> CAST(sum(IIF(category=="A",1,0)) AS I)	A is 3
Select myTable.*, AddSQL.CatCount from myTable ;
inner join (select Category, count(*) as CatCount ;
from myTable group by 1) AddSql on myTable.Category = AddSql.Category
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform