Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Get records
Message
De
29/08/2004 17:40:34
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
29/08/2004 17:21:34
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00937427
Message ID:
00937439
Vues:
15
>hi,
>thank you for reply.
>
>at mytable field(flage) i have many records with flag=1,
> many records with flage=2, and flage=3 s etc...,
>i need to get 5 records form flag=1 ,5 record form flage=2,and 5 records from flag=3 ..etc to insert to new table.
>
>thanks

One way to do this is like this:
select table1
set order to "flag"
for i = 1 to 20 && assume 20 values for flag
  seek i
  copy next 5 to temp while flag = i
  select table2
  append from temp
next
This will get the first 5 records in each group. If you want to select records randomly, it will be a little more complicated.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform