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

How to write character string constants or literals in ms sql server?

1040


Why olap is used?

986


Write the queries for commands like Create Table, Delete table, Drop Table etc.

1120


What is transaction server distributed transaction?

1066


How to write a query with a full outer join in ms sql server?

1095


What is bit data type? What's the information that can be stored inside a bit column?

933


Tell about MOM Tool(Microsoft Operator Manager)?

1923


How to create dbo table in sql server?

965


What according to you is the difference between mysql and sql server performance?

1099


What is spid in sql server profiler?

1120


What happens if null values are involved in bitwise operations?

1041


What is schemabinding a view?

927


How to create function with parameter in sql server?

1118


Can sub report data source be different from that of the parent report?

146


1.how to find the dead lock in sql server? 2.How to fine the memory leaks in sql server? 3.suppose transaction log file increasing what action will take ?

2037