Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
GROUP BY 1 no longer works
Message
From
19/02/2003 22:40:39
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
19/02/2003 13:07:39
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00750415
Message ID:
00755323
Views:
16
>>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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform