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
How to write character string constants or literals in ms sql server?
Why olap is used?
Write the queries for commands like Create Table, Delete table, Drop Table etc.
What is transaction server distributed transaction?
How to write a query with a full outer join in ms sql server?
What is bit data type? What's the information that can be stored inside a bit column?
Tell about MOM Tool(Microsoft Operator Manager)?
How to create dbo table in sql server?
What according to you is the difference between mysql and sql server performance?
What is spid in sql server profiler?
What happens if null values are involved in bitwise operations?
What is schemabinding a view?
How to create function with parameter in sql server?
Can sub report data source be different from that of the parent report?
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 ?