Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Random generation
Message
From
13/05/2005 07:46:28
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
13/05/2005 07:18:39
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01013774
Message ID:
01013788
Views:
12
>hi all,
>
>i am expected to generate a question paper consisting of 150 questions from a database of 2500 questions. Further, I am supposed to generate the question paper each time someone is required to take a test by RANDOM selection of questions from the above database.
>
>Can someone please enlighten me as to how i can go about RANDOMLY selecting 150 questions each time as i do not have the slightest idea as to how to go about this task ?
>
>With sincere thanks.

rand(-1)
select top 150 rand(), * from questions order by 1

PS: Depending on version you've a chance to get more than 150.

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