Code Ninja
Tactics against hostile code....
Pages
Home
.NET
SQL
Search Engines
SharePoint
Cloud
Other
About Me
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
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment