Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL GROUP BY Question
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01082935
Message ID:
01084210
Vues:
12
>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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform