Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is a linked server in sql server?

1053


Can group by be used without aggregate functions?

896


What is set nocount on and what is set nocount off?

924


What are the different ways you can create databases in sql server?

1079


What are the differences between decimal and float in ms sql server?

1206


What is after dml trigger?

991


Explain the etl (extraction, transformation, and loading)?

978


What is “asynchronous” communication in sql server service broker?

1012


What is the datatype of rowid?

902


What is #temp and @table variable in SQL server?

1062


What is the difference between MVC and Teir Architecher? Plz explain with Layyered Programming example...? Thanks

2042


Explain the difference between primary keys and foreign keys?

1002


How can I create a report based on a query? : sql server management studio

997


When would you prefer to have a minimum number of indexes?

880


How to backup SQL Server Reporting Services ?

148