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

Is it ok to shrink transaction log?

1057


what are the disadvantages of cursors? : Sql server database administration

1086


Indexes are updated automatically is the full-text index also updated automatically?

1071


How to convert numeric expression data types using the cast() function?

1120


When multiple after triggers are attached to sql table, how to control the order of execution?

1108


Explain magic tables in sql server?

1106


How do you rename a table in sql server?

1102


What is open database communication (odbc)?

1118


What is extent? Types of extents?

1277


What is a field in a table?

1075


What does this statement do @@rowcount?

1016


How to use subqueries in the from clause in ms sql server?

1211


how many type of indexing in database?

1021


Explain the flow of creating a cube? : sql server analysis services, ssas

1102


What are the kinds of subquery?

1073