Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Randomly select n unique codes from 5mln table
Message
From
08/11/2001 13:50:02
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00579211
Message ID:
00579270
Views:
23
This message has been marked as a message which has helped to the initial question of the thread.
>>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...
>
>Ok, I have an idea by myself.
>1) Select code group by 1 into cursor curTemp
>
>2) Randomly find a number between 1 and _tally (repeat 110 times)
> Put each record with this recno() in temp table.
How about :

rand(-1)
select top 110 rand(),* from mytable order by 1 into cursor myRands

Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform