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
What are user defined functions in ms sql server?
How to enter unicode character string literals in ms sql server?
How to defragment table indexes?
How many types of the database links?
How can i Relate Tables in SSIS
Can we write ddl in trigger?
How to define output parameters in stored procedures?
What should be the fill factor for indexes created on tables? : sql server database administration
1. Tell me your daily activities 2. If sql server installation fails at time installation what will do 3. Where does the sql server installation log details are stored 4. After the installation what will you do for memory configuration 5. What is the difference between SQL max maximum memory and AWE memory 6. How will you configure AWE memory 7. How will setup an email alert for the backup job 8. After the SQL installation what are the jobs will you configure 9. What does –g mean in the sql startup parameter 10. What is the difference between Bulked log and Full recovery model 11. What is the difference between mirroring and log shipping 12. What are the steps to be followed before in-place up gradation 13. After installing the patch the sql server does not start and application team tells to rollback the changes .In this scenario what will you do
What happens when transaction log is full?
Explain unique key in sql server?
How would you choose between a clustered and a non-clustered index?
How adventureworkslt tables are related?
Explain what are the basic functions for master, msdb, model, tempdb databases?
Why do we use non clustered index?