The
NewId() in-built function generates a unique value of type
uniqueidentifier.We have to include the NewId() in-built function in the
Order By clause in the
Select statement.
We can understand NewId() function with simple example:
select top 20 emp_id,employee_name,email_id,pan_number,address
from employee_master
order by newid();
It will generate 20 random rows.