Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is this a BUG?
Message
De
11/06/2003 08:33:58
Cindy Winegarden
Duke University Medical Center
Durham, Caroline du Nord, États-Unis
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00798818
Message ID:
00798841
Vues:
13
>CREATE TABLE DooSumi (NadvDoo N(14,2), SumaDoo N(14,2), Mes N(2), God N(4), Egn C(10))
>CREATE TABLE AddSum (Bruto N(14,2), Mes N(2), God N(4), Egn C(10))
>INSERT INTO DooSumi (NadvDoo, SumaDoo, Mes, God, Egn) VALUES (100, 50, 2, 2003, "1111111111")
>INSERT INTO DooSumi (NadvDoo, SumaDoo, Mes, God, Egn) VALUES (120, 50, 2, 2003, "1111111111")
>INSERT INTO DooSumi (NadvDoo, SumaDoo, Mes, God, Egn) VALUES (120, 50, 2, 2003, "1111111111")
>
>INSERT INTO AddSum (Bruto, Mes, God, Egn) VALUES (100, 2, 2003, "1111111111")
>
>SELECT SUM(NadvDoo + SumaDoo) + NVL(AddSum.Bruto,0) AS All_Nadv;
>       FROM DooSumi;
>       LEFT JOIN AddSum ON DooSumi.Egn+STR(2003,4)+STR(2,2) == AddSum.Egn + STR(AddSum.God,4)+STR(AddSum.Mes,2);
>       WHERE DooSumi.Egn == "1111111111" .AND. DooSumi.Mes == 2 .AND. DooSumi.God == 2003;
>       GROUP BY DooSumi.Egn, DooSumi.Mes, DooSumi.God;
>INTO CURSOR TempDoo
>
>and VFP 8.0 rises the error SQL: GROUP BY clause is missing ot invalid"
>when I remove "+NVL(AddSum.Bruto, 0)" everything is OK. I thing the All_Nadv Field in TempDoo IS agregate, but maybe I am wrong ???

Hi Borislav,

In your SELECT clause NVL(AddSum.Bruto,0) AS All_Nadv is not aggregated, even though it is added to an aggregated field. The code worked with AddSum.Bruto added to the GROUP BY clause. You don't need to include DooSumi.Egn, DooSumi.Mes, DooSumi.God in the GROUP BY clause since these fields don't appear in the SELECT clause. In any case, grouping by them is not meaningful since you can't see what the values were.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform