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

A table contains list of customers and his city with other
details. Each customer has a unique number and the table
consists millions of data. Query is: I want to retrieve 10
customers from each city, no script, only from single query?

Answer Posted / grace

SELECT A.*
FROM dbo.T1 A
WHERE CustomerID IN
(SELECT TOP 10 CustomerID FROM dbo.T1 WHERE City=A.City)

Is This Answer Correct ?    24 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is normalization and denormalization in sql server?

1065


What is replication with database mirroring? : sql server database administration

1154


How to use union to merge outputs from two queries together in ms sql server?

1138


You have to store user responses of ‘yes’ and ‘no’ what kind of data type is best suited for this task?

995


Can we linked SharePoint to a SQL database?

1079


What is the cartesian product of the table?

1009


What guidelines should be followed to help minimize deadlocks?

995


What is coalesce and check constraint in sql server?

1179


How to backup encryption key ?

191


what are the new features in SSRS?

147


What is parameterized reports in ssrs ?

163


explain databases and sql server databases architecture? : Sql server database administration

1017


How to find out the list schema name and table name for the database?

984


In what three ways is the return statement used in a stored procedure?

1066


Explain important index characteristics?

1083