/ Published in: SQL
Sometimes you want to return a bunch of data from a table, but you want it coming back in a random order. Maybe it's for keeping some content on a home page fresh. Here's how:
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
SELECT TOP 10 * FROM [someTable] ORDER BY NEWID()
URL: http://codefinds.blogspot.com/2008/08/randomize-query-in-sql.html