Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select Distinct
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
00779949
Message ID:
00779960
Vues:
13
>Is there a way to Select...Distinct from a table and have the resulting records be un-ordered, or following the natural order of the source table? I have tried select ... Distinct and also Select...Group By and the results are always sorted.
>
>TIA,

AFAIK, no. Distinct is the same as including all selected fields in the Group By clause.
select distinct field1, field2, field3 from table1 = select field1, field2, field3 from table1 group by field1, field2, field3
You could create an intermediate result set that was ordered and then use another SQL statement to order it in some other way for the final result set.

HTH.

P.S. Why do you need the final result set in the natural order of the table?
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform