Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What parameter to use fo this COUNT()
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 SP1
Divers
Thread ID:
01259476
Message ID:
01259484
Vues:
17
Hi Martina,

I was mistaken in my initial message/question. COUNT(*) was returning the total number of records in each group. Borislav corrected my mistake. And I understand that NULL values are not counted.

Thank you very much for your input.

>Hi Dmitry,
>
>char "*" or any field. It's depends what you need.
>
>If you use * or any field which dont' support NULL value, then COUNT() return all "records". If you use any field which support NULL value, then COUNT() don't compute NULL values.
>
>MartinaJ
>
>>Can someone suggest the right parameter to pass to COUNT() function of SQL Select to accomplish the following:
>>
>>Table fields
>>ID, C
>>WEEK, N
>>HRS, N
>>
>>
>>select week, id, sum(hrs) as week_hrs, count(???) as week_cnt from
>>mytable group by week, id
>>
>>
>>I want the week_cnt in the above SQL Select to count how many records found for a given WEEK and given ID. I tried using count(*) but it gives me total of all records.
>>
>>I would appreciate any suggestions.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform