Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Last 10 records based on a condition
Message
 
 
À
30/12/2001 22:13:26
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00599284
Message ID:
00599287
Vues:
20
>I need to get the last 10 records of a table based on a condition. However, that table is pretty big and I don't want to use the TOP 10 clause as it will take too long. What type of approach can I use which would be the best? I am looking for a SQL approach. If that is not possible then I'll consider using code.

How do you know that TOP 10 would take too long? Try
SELECT TOP 10 *, RECNO() AS recno ;
  FROM mytable ;
  WHERE < your condition > ;
  ORDER BY Recno DESC ;
  INTO CURSOR mycursor
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform