Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How Do You All Handle Group By Command
Message
De
31/07/2006 21:11:05
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
 
 
À
31/07/2006 16:48:08
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01141909
Message ID:
01141983
Vues:
17
>Hi Albert,
>
>I think the way it should be handled is that you split the SQL into two different SQL statements. The first one will just have the primary key field and the fields being aggregated, then you join the result of that SQL with the original table to get the other fields that you want.

Sometimes this is a must, specially if memos are involved, or you just feel it's silly to include customer.name in the group by (i.e. any repeating field from a joined table).

Generally, it would be nice if we had a first() or last() aggregate function, so we could use them on such fields where we don't really care from which record will the value come.

I write the new SQLs to be 80 compliant. As for the old ones, I usually convert them all, and try to have the time to do that. Sometimes, situations when I have to include the unimportant fields (which are either repeating or included because the customer wanted some reminder in the report) are a real waste of time, specially when some field needs to be added/removed - and then one has to remember to add/remove it in the Group By as well.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform