display rows randomly in an SQL Query

Posted by Ddd under Sql Server category on | Points: 40 | Views : 1667
Suppose we want to display 3 rows randomly from an sql server table.

I have taken the northwind database.

select top 3 * from products order by newid()

Comments or Responses

Login to post response