|
 |
Thursday, September 30, 2004 |
I was pretty frustrated with SQL today attempting to get back five random rows from a table.
The problem is that the RAND() function only runs once per execute - not once per row.
My solution around it:
SELECT TOP 5 * FROM tableName ORDER BY
NewID()
12:44:40 AM
|
|
© Copyright 2004 nick gaydos.
|
|
|