>When there is no ORDER BY clause, the GROUP BY clause seems to cause the records to be
>returned ordered by the group column.
>
>I don't see this in the docs. Is this the correct behaviour?
Hi Kevin,
As Sergey and others pointed out, it is not recommended to rely on side-effects or undocumented behavior. Often, this behavior is subject to change under different circumstances or from version to version. With SQL language, the order of records returned by a query without ORDER BY is undefined. Very often, VFP itself is able to eliminate redundant ORDER BY. For example, for the following query:
SELECT f1,f2,f3, MAX(f4) from SomeTable GROUP BY f1, f2, f3 ORDER BY f1, f2
I am pretty sure other databases are able to do the same.
Thanks,
Aleksey.