Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Upgrading, GROUP BY question
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01313609
Message ID:
01313622
Vues:
13
>I'm upgrading a VFP7 app to VFP9. I understand that all non-agregate fields should be included in the GROUP BY clause. Am I mistaken to assume that the primary group should be listed first? If the other fields are included only to make the select work, does it matter whatorder they are listed in?
>
>Is there a downside to listing many fields in the GROUP BY clause?
>
>Is there a better (or proper) way to handle this?
>
>Thanks in advance for any help clarifying.

Yes, primary group should be listed first. For the rest you may use some aggregate function such as min (max) if you don't want to list these fields in the GROUP BY, e.g.
select myGroupField, max(myOtherField) as myOtherField, etc. .... group by 1
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