Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Group by clause
Message
De
27/02/2012 08:53:20
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Divers
Thread ID:
01536615
Message ID:
01536621
Vues:
39
>All fields, that are not listed in GROUP BY clause, must be in any aggregate function.
>
>So, your query will be
>
>
>>   SELECT SUBSTR(f850nfac,2,4) as cpues, f850grav as cgrav, f850ivai as civai, f850exen as cexen, SUM(f850tota) as ctota, .t. as celijo ;
>>          FROM &ivaventa WHERE LEFT(DTOS(f850ffac),6)==thisform.peri GROUP BY 1,2,3, NOCONSOLE INTO CURSOR cpuesto
>
Hi Naomi:

That's it. Actually I wanted to sum 2 throught 5 fields but as I failed so many times in the past I concentrate on "GROUP BY" and I haven't include SUM at first. Anyway I didn't know you have to include every field that doesn't have an "aggregate function". Today I've learned something new.

Thank you and Tamar very much.

Héctor
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform