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