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

Can truncate be rolled back?

953


Write a query for primary key constraint with identity key word?

1034


How many types of subqueries are there in sql server?

993


What are clustered and non-clustered index?

1012


Where is my database stored on the hard disk in ms sql server?

1066


What is a document index?

1035


Why is normalisation important?

951


Determine when to use stored procedure to complete sql server tasks?

1059


What command is used to delete a table from the database in the sql server and how?

1119


What is trigger explain with program?

986


How to create an inline table-valued function?

982


What are different types of statement?

1021


What are constraints in microsoft sql server?

1144


What is full outer join in sql server joins?

1074


What is a transaction and why is it important?

1093