select top 5 * from emp order by newid()
my question is , how this query get executed?
Answer Posted / sanjeev kumar
newid() used with uniqueidentifier data types in a table
and uniqueidentifier datatype is used to insert randomly
new number, so the above query will give top 5 records in
randomly manner.
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
While using a cursor, how can you differentiate between a deleted row and a row that has been inserted with null data values?
Mention the 3 ways to get a count of the number of records in a table.
How to replace the Query Result 'Null Value' with a text ?
Explain about Normalization?
how to trace the traffic hitting a sql server? : Sql server database administration
How many types of schemas are there?
What is difference between commit and rollback when used in transactions?
Why we need sql server?
If a table does not have a unique index, can a cursor be opened on it?
Is INSTEAD OF trigger directly applicable to Table ?
what stored procedure would you use to view lock information? : Sql server administration
How to write an inner join with the where clause in ms sql server?
what are different types of backups available in sql server? Given a particular scenario, how would you go about choosing a backup plan? : Sql server database administration
What are the different type of replication in sql server?
Explain go command in sql server?