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:
00779966
Vues:
10
>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
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform