Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Site Related Forums
 Article Discussion
 Article: Multiple Random Records w/Single Select

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2000-10-03 : 18:01:43
Reverend writes "This has got me. I am looking for a way to create a record set with multiple random values using a single, non-iterated/non-looped, select statement. On a 265 record DB I even tried . . .

Article Link.

Channing_Jones
Starting Member

2 Posts

Posted - 2003-12-09 : 12:00:09
You can also use the Sine-function to generate a nearly-random sequence:

"select top 10 * from myTable order by Sin(UnitID * Rand() * 1000)"

With UnitID being a unique value for each record. The 1000 ensures that the numbers are not within the same 2pi-period.
Go to Top of Page

kamleshdorle
Starting Member

1 Post

Posted - 2010-04-23 : 01:58:11
I have saved 1000 Question in Sql server 2005 database table And I want to retrieve the any 50 questions in random order just like the online exam pattern for perticular session.

MY name is Kamlesh
Go to Top of Page
   

- Advertisement -