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 protocol does sql server use?

986


What do you understand by the analysis services in sql server?

981


What is 2nf in normalization?

1054


You want to implement the many-to-many relationship while designing tables. How would you do it?

1044


What is an indexing technique?

980


What is a trigger what are the advantages of trigger?

1062


What does nvl stand for?

992


Explain try...catch with sql server?

1071


What is the stuff and how does it differ from the replace function?

1224


How to enter unicode character string literals in ms sql server?

1118


Is sql different from sql server?

1161


What are Spatial data types in SQL Server 2008

1069


Can primary key be null?

982


When cursors are useful?

1168


Do you know concepts and capabilities of sql server?

1107