Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Get records
Message
From
29/08/2004 17:40:34
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
29/08/2004 17:21:34
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00937427
Message ID:
00937439
Views:
14
>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)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform