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

Is INSTEAD OF trigger directly applicable to Table ?

960


What are the elements of dbms?

923


What is it unwise to create wide clustered index keys?

957


List few advantages of stored procedure.

928


What languages bi uses to achieve the goal?

948


Tell me about pre-defined functions of sql?

1072


What are the tables in sql?

1041


How do I open a .db file?

974


Can we store videos inside the sql server table?

910


What is the difference between varchar and nvarchar datatypes?

1037


How many joins in sql server?

901


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

895


Explain use of expression builder.

953


Which are the two editions in which SQL Azure database available?

117


What is the order in which the sql query is executed?

882