Randomly Sorting Records in Sql Server.

Posted by Vishalneeraj-24503 under Sql Server category on | Points: 40 | Views : 1031
Using the NEWID() method,we can sort records randomly.The code below selects 10 random rows from "employee_master" table.

select top 10 employee_id,employee_name from employee_master order by newid();

Comments or Responses

Login to post response