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:
00779969
Vues:
12
>>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,
>Jeff,
>
>When you don't specify ORDER BY clause VFP is free to return records in any order. You should not relay on the order of records returned in this case. Here's how you can specify the order you want.
SELECT *, RECNO() AS RecordNo ;
>  FROM mytable ;
>  INTO CURSOR crsNumbered
>SELECT DISTINCT ... ;
>  FROM crsNumbered ;
>  ORDER BY RecordNo
Sergey,
I don't think this will DISTINCT the result set. The recno() field will be distinct unto itself so even if all the other fields match, the additional field will cause the record to display, when it shouldn't.
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