random selection (1 Viewer)

iainv

New member
Local time
Today, 10:06
Joined
Jan 18, 2003
Messages
5
I want to run a report that will return 10% random selection of dataheld in a table. Can anybody help
 

Rob.Mills

Registered User.
Local time
Today, 05:06
Joined
Aug 29, 2002
Messages
871
I assume if you use a select statement such as this:

SELECT TOP 10 PERCENT

without giving it an ORDER BY clause then it will randomly pickup 10%.
 

Mile-O

Back once again...
Local time
Today, 10:06
Joined
Dec 10, 2002
Messages
11,316
Although "random" to a point, the TOP 10 PERCENT picked out the same records every time.

If you want to generate completely random records then you might want to have a look at the random test generator I posted on this thread and adapt the code.
 

Users who are viewing this thread

Top Bottom