Random 5 rows from the table in SQL SERVER2008

Posted by CGN007 under Sql Server category on | Points: 40 | Views : 1538
SELECT TOP 5 [column names] FROM [table name] ORDER BY NEWID()

Comments or Responses

Posted by: Ksuresh on: 6/13/2012 Level:Starter | Status: [Member] | Points: 10
hi ,

can i give dynamically count of rows in place of you mentioned " Top 5 " , if yes how ? please help me in this.


Login to post response