select top 5 * from emp order by newid()

my question is , how this query get executed?

Answer Posted / anil sharma

newid() function return random row and top 5 return top 5
rows.
So query return top 5 row using random order.

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the dis_advantages of stored procedures, triggers, indexes?

1687


where can you add custom error messages to sql server? : Sql server administration

580


What is SQL Azure Firewall?

116


Can a unique index be created on a column, which contains null?

523


What is the purpose of a table?

518






Will the writetext statement activate a trigger?

571


How to fetch the next row from a cursor with a "fetch" statement?

589


What are the different ways you can create databases in sql server?

570


explain different types of constraints? : Sql server database administration

515


What is sql server query analyzer?

509


Explain about remote stored procedure?

590


What is the main purpose of having conversation group?

498


What is store procedure? When do you use?

524


Explain the dirty pages?

575


Explain primary key and foreign key constraints?

523