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

select top 10 *
from tablename
where city IN
(select distinct(city) from tablename)

Is This Answer Correct ?    1 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to use clusters?

970


Give me any three differences between Truncate and Delete.

1119


What is global temp table?

1007


How to round a numeric value to a specific precision?

1085


How to enable tcp/ip protocol on a sql server?

1182


Tell me what do you mean by an execution plan? Why is it used? How would you view it?

889


Explain about Joins?

999


Tell me what are the advantages of using stored procedures?

1025


Name three of the features managed by the surface area configuration tool? : sql server security

1006


Explain index in sql server?

1027


What is clustered index

1021


What is sql server management studio? : sql server management studio

1092


Does dbcc checkdb requires db to be in single_user mode? : sql server database administration

989


How to get a list of columns in a view using the "sp_columns" stored procedure?

1050


List some advantages and disadvantages of stored procedure?

1024