Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select last 50 records from a table into another table
Message
 
À
16/07/1997 11:51:19
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00040160
Message ID:
00040331
Vues:
30
>>I have a table with hundreds of records, which can be divided into three groups. What I am going to do is to select the last 50 records for a group, let's say group A,from this table. Is it possible to issue a SQL command and let the thing done? Thanks!
>
>
>SELECT TOP 50
>...
>
>gives you first 50 records. To have the last 50 you can do something like
>
>SELECT TOP 50
>...
>ORDER BY ... DESC
>...
>
>Claude

If you are working in VFP5, Ron's method works. In VFP3 you don't have the "TOP nn" option, so you need to get the WHOLE table. Order it with the DESC clause, then copy to another table:

COPY to Newtable while Recno() <= 50

Should be quite fast.

Barbara P.
Barbara Paltiel, Paltiel Inc.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform