Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Selecting TOP 5 but in reverse order
Message
De
05/07/2006 00:40:39
 
 
À
05/07/2006 00:37:24
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01133722
Message ID:
01133724
Vues:
15
>For a report (i.e., R/O), you could put the result (in the wrong order) into a cursor, and then SELECT from that cursor into a second cursor.
>
>Another option is to create a temporary index.
>
>I don't know a way to do it with just one SELECT command.

This is with OleDb, so I need to find a way to have this using one SQL. One way I have thought would be to select with the default order, thus ascending, go at the end, skip -5, get the date and do another SQL with the DESC order having a condition on the date to get only the five records I want.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform