Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Group by in VFP 8.0
Message
From
25/08/2003 15:47:19
 
 
To
25/08/2003 15:24:58
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00823169
Message ID:
00823179
Views:
24
This has been gone over about a thousand times here, but in essence it boils down to this. The value returned by any field not included in the group by clause is pretty much meaningless. It bears no real relationship to the group itself. VFP has chosen to return the last value in the group in those fields, but that decision is arbitrary.

If you have 3 fields - name, age, height, and you do a group by only on name where the table contains 3 "Alan's", which Alan's age and height are you looking at when the group is returned, and of what value is it?

The change was made to bring VFP in line with Ansi standards, and to get rid of any confusion about the value of what is returned in the group.

Alan

>Hi!
>I'm looking for some explanation on the radical change
>in the group by clause
>
>a quote from VFP 8.0 help
>"The GROUP BY clause must list every field in the SELECT list except for fields contained in an aggregate function, such as the COUNT( ) function. "
>
>I found it while converting a running project from 7.0 to 8.0 a great amount of my reports don't work (all of them based on queries)
>
>well: I know I could issue a SET ENGINEBEHAVIOR 70 but then I might miss other new stuff related to 8.0, don't I?
>
>actually I would like to know what is the reason for this change that is going to make me write GROUP BY statemnts for 20, 30 and sometimes more fields.
>
>am I missing something?
>
>thanks in advance,
>
>Nir.
Previous
Reply
Map
View

Click here to load this message in the networking platform