Monday, February 27, 2012

Returning rows in random order from MS SQL Server

Have you ever needed to return rows from MS SQL Server in random order every time you execute query? Here is simple solution to achieve this.

select top 10 * from some_table order by newid();

No comments:

Post a Comment