Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
New SQL: What's with the GROUP BY error?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00853362
Message ID:
00853395
Vues:
13
>OK, that makes more sense but it still doesn't follow the rules. You are only grouping on Detail.bccode. All other fields in Detail as well as Codes.Desc are going to be junk (or could possibly be). See Thread#852868 for more information.
>>
>>SELECT Detail.*, count(*) as Total, Codes.desc;
>> FROM ;
>>     detail ;
>>    LEFT OUTER JOIN codes ;
>>   ON  Detail.bccode = Codes.code;
>> GROUP BY Detail.bccode;
>> ORDER BY Detail.bccode
>>
Ok, I kinda get a feel for "the rule". I agree with the notion that the best solution means not using SET ENGINEBEHAVIOR as a workaround --- but only with new stuff. I've got acres of old code by programmer-de-jour to support that I'm not going to "fix" with anything but SET ENGINEBEHAVIOR 70. (Ya know, I've actually found some of these 'junk' fields referenced in code.)

So, if starting from scratch I would choose to do it as (below)

Thanks Larry,
Steven-
-------------------------------------
SELECT Detail.bccode, count(*) as Total, Codes.desc;
 FROM ;
     detail ;
    LEFT OUTER JOIN codes ;
   ON  Detail.bccode = Codes.code;
 GROUP BY Detail.bccode, Codes.desc;
 ORDER BY Detail.bccode
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform