select top 5 * from emp order by newid()
my question is , how this query get executed?
Answer Posted / praveen n h
SQL server will execute the query in following way...
Select All top 5 rows which are created in the table from
the time it is created.
reason: newid is the key given to each row regardless of
the values that goes into the row of the table.
For example.
if you have created a table temp
and inserted 10 rows, Only fives rows which are created
first will be listed.
Is This Answer Correct ? | 2 Yes | 6 No |
Post New Answer View All Answers
Describe in brief system database.
What are the differences between substr and charindex in sql server.
1.how to find the dead lock in sql server? 2.How to fine the memory leaks in sql server? 3.suppose transaction log file increasing what action will take ?
Define synonym?
What is the report model project?
What is the definition for sql server 2000?
Explain for xml explicit mode?
Why union all is faster than union?
Can we shrink data file in sql server?
What is a data source file?
How do I start sql server 2016?
How to replace the Query Result 'Null Value' with a text ?
How to enable/disable indexes?
Does sql server use t sql?
What is policy based management (pbm)? : sql server database administration