Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Count the records
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Database:
Visual FoxPro
Divers
Thread ID:
01310624
Message ID:
01310674
Vues:
14
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform