You can sort any way you want. It's irrelevant to your problem. The fact that query runs in Fox 2.x doesn't mean that it produces correct result. See
Re: Change in SQL commands! Message #
941774>My try is about to have the result in desc order.. a cursor with the best seller products to the less one.. May I have to sort..I tried the same on 2.6a and I give a good result.. with 'group by' diff of 'order by'
>
>>
>>Once again, you have to group on all none-aggregate fields
>>
>>SELECT SUM(qty) as tot_qty, SUM(tot) as sumt, client, codesy, unit, comiss;
>>...
>>GROUP BY client, codesy, unit, comiss ;
>>
>>* if grouping on codesy only
>>
>>SELECT SUM(qty) as tot_qty, SUM(tot) as sumt, codesy ;
>>...
>>GROUP BY codesy ;
>>
>>
--sb--