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 / 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


Please Help Members By Posting Answers For Below Questions

While using a cursor, how can you differentiate between a deleted row and a row that has been inserted with null data values?

1044


Mention the 3 ways to get a count of the number of records in a table.

978


How to replace the Query Result 'Null Value' with a text ?

1043


Explain about Normalization?

1069


how to trace the traffic hitting a sql server? : Sql server database administration

1879


How many types of schemas are there?

1042


What is difference between commit and rollback when used in transactions?

959


Why we need sql server?

970


If a table does not have a unique index, can a cursor be opened on it?

915


Is INSTEAD OF trigger directly applicable to Table ?

1017


what stored procedure would you use to view lock information? : Sql server administration

976


How to write an inner join with the where clause in ms sql server?

1091


what are different types of backups available in sql server? Given a particular scenario, how would you go about choosing a backup plan? : Sql server database administration

923


What are the different type of replication in sql server?

981


Explain go command in sql server?

1040