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

you have a table with close to 100 million records recently, a huge amount of this data was updated now, various queries against this table have slowed down considerably what is the quickest option to remedy the situation? : Sql server administration

948


How to apply cascading referential integrity in place of triggers?

1034


What is the difference between join and inner join?

1014


What is a print index?

886


what authentication modes does sql server support? : Sql server database administration

1115


define and explain the differences between clustered and non-clustered indexes.

1196


How will you optimize a stored procedure optimization?

1042


How to use clusters?

947


How to create a local temporary stored procedure?

998


Please explain go command in sql server?

1057


What is NOT NULL Constraint in sql server 2012?

1001


What is the architecture of ms sql reporting service?

985


Help!!!!!!!!!!!! My database has gone offline, it is highlighted as 'Suspect'. Foolishly, i haven't got a recent back up. Is there a way of quickly restoring the database? Thank you

1750


How to use "if ... Else if ... Else ..." Statement structures in ms sql server?

1080


What is difference between createstatement and preparedstatement?

1091