Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select last 50 records from a table into another table
Message
De
17/07/1997 01:32:10
Ron Tse-Jung Huang
Leader Professional Consulting
Shin-Chu, Taiwan
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00040160
Message ID:
00040369
Vues:
26
>>>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.

Dear Claude and Barbara,

Many thanks for your suggestions for resolving the problem. I will try that.

Best regards,
Ron.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform