Posted By

blackf0rk on 03/12/09


sql random

Versions (?)

Randomize Query in SQL

 / 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:

  1. SELECT TOP 10 * FROM [someTable] ORDER BY NEWID()

Report this snippet  

You need to login to post a comment.