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
How can a database be repaired?
What is a partition function in sql server?
how can you attach more than 20 ldf files in sql server
What is the recovery model? List the types of recovery model available in sql server?
What do you mean by 'normalization'?
What are the steps to take to improve performance of a poor performing query? : sql server database administration
Is it possible to update the views? If yes, how, if not, why?
What are the instances when triggers are appropriate?
How you can move data or databases between servers and databases in sql server?
How to fetch the next row from a cursor with a "fetch" statement?
Explain having clause and where clause?
Can sql servers linked to other servers?
What are difference between Cluster index and Non-Cluster index?
Why SQL Agent is used?
How to see the event list of an existing trigger using sys.trigger_events?