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 21:11:05
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
 
 
To
31/07/2006 16:48:08
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:
01141983
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.

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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform