Randomly Sorting Records in Sql Server.

Vishalneeraj-24503
Posted by Vishalneeraj-24503 under Sql Server category on | Points: 40 | Views : 1153
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