Search This Blog

2010-05-02

How to get records in random order from a sql query in sql server?

In SQL Server we can get records in random order from a sql query using NEWID() Function like:

SELECT Subject FROM dbo.test ORDER BY NEWID()

No comments: