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
Is it ok to shrink transaction log?
what are the disadvantages of cursors? : Sql server database administration
Indexes are updated automatically is the full-text index also updated automatically?
How to convert numeric expression data types using the cast() function?
When multiple after triggers are attached to sql table, how to control the order of execution?
Explain magic tables in sql server?
How do you rename a table in sql server?
What is open database communication (odbc)?
What is extent? Types of extents?
What is a field in a table?
What does this statement do @@rowcount?
How to use subqueries in the from clause in ms sql server?
how many type of indexing in database?
Explain the flow of creating a cube? : sql server analysis services, ssas
What are the kinds of subquery?