Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Randomly select n unique codes from 5mln table
Message
 
 
To
09/11/2001 15:31:49
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00579211
Message ID:
00579928
Views:
30
>>Hi everybody,
>>
>>How can I randomly select n (110) codes from some huge table, so these codes would be unique? I'm trying to create a test case now...
>
>I was forgetting that I had, at some moment, used something like:
>
>
>copy to sample for recno() % 1000 = 0
>
>
>In other words, copy all records whose recno() is a multiple of a certain number.
>
>Quick to code, not so quick in executing.
>
>Hilmar.

That's essentially the same idea, as Mike's. I would first select all unique codes in table, then using some random number, select records for recno()%RandomNumber = 0.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform