Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
GROUP BY 1 no longer works
Message
De
19/02/2003 22:40:39
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
19/02/2003 13:07:39
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00750415
Message ID:
00755323
Vues:
38
>>Can you supply an example (not necessarily code) of what you meant as regards there being no record in your prior?
>
>Simple case. Suppose the query used SUM() instead of MIN(). What would be the correct record to draw a field from, if it's neither in GROUP BY nor uses an aggregate function?

Frankly, I'd accept first or last, if only it was sure to behave the same each time.

This was always a gray area, but then for the cases where you wanted one of the values for that field (and didn't really care which), this was a nice loophole.

Of course, having an aggregate function ValueOfAWhenMaxB(fieldA, FieldB), which would return the value of FieldA from the record where FieldB=max(FieldB) would be even better. That would help in all the cases when we need to know the date when temperature was lowest, or the customer who bought most of a certain item... but then, we can always roll our own for such cases.

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