Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How Do You All Handle Group By Command
Message
From
31/07/2006 16:48:08
 
 
To
31/07/2006 15:32:07
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01141909
Message ID:
01141940
Views:
26
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.

>Hi Y'all,
>
>I am just updating an app from VFP7 to 9 and knew I would have to deal with the change to the "GROUP BY" part of SQL. I have quite a few spots where I grouped by a single field or two before but now this needs updating. Some SELECT statements have a lot of fields so I don't relish adding all the new fields to the GROUP BY list.
>
>How have some of you handled this?
>
>a) just add them all and quit complaining :-)
>b) write a function to dig out all of the table names in a string and macro expand it (with the original "group by" field first)
>
>I realize that the new syntax is indeed better - I used to have to sometimes sort things in a particular order to get the desired result - because the old way would take the value of a non-grouped field from the *last* record read it seemed.
>
>Thanks,
>
>Albert Gostick
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform