SELECT TOP 900 *
FROM Table
WHERE foo=bar
ORDER BY NEWID()

________________________________

From: James Smith [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 28, 2004 10:16 AM
To: CF-Talk
Subject: Randomising a query

Is there any way to randomise a query result set?  I was thinking of
adding...

SELECT rand() AS RandomColumn, OtherQueryFields, .......
FROM .......
WHERE .......
ORDER BY RandomColumn

to the query but am not sure if this will produce a good randomisation, it
doesn't need to be perfect, just good.

I am selecting about 800-900 records of which 400-800 will be used (don't
ask!) and I need to make sure that (on average) they are all used.

--
James Smith
[EMAIL PROTECTED]
________________________________
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to