Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Set EngineBehaviour 80
Message
From
11/05/2004 08:56:15
 
 
To
11/05/2004 01:50:31
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00902709
Message ID:
00902782
Views:
14

I didn't have any problem prior VFP8 with the following SQL

SELECT CODE,SUM(freq)*10 FROM csearch GROUP BY code ORDER BY CODE,origin INTO ARRAY arank6

With default VFP8 engine it complains

SQL: Order by clause is invalid

The only way which I see to make it work under VFP8 is to change to

SELECT CODE,SUM(freq)*10,origin FROM csearch GROUP BY code,origin ORDER BY CODE,origin INTO ARRAY arank6

Online help says about "GROUP BY clause must list every field in the SELECT list except for fields contained in an aggregate function". Does it aply to Order clause also ?

Thanks
Michael


This is a false problem, because when you grouping a resultset, it have not sense order the result respect a field not included into the grouping space.
This assertion is not true before VFP8 because VFP7 and before they allow not grouping/aggregate suborder selection.

Then, in VFP8 this is sufficient:
SELECT CODE,SUM(freq)*10 FROM csearch GROUP BY code INTO ARRAY arank6
Fabio
Fabio
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform