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

What is a collation?

1131


tell me what is blocking and how would you troubleshoot it? : Sql server database administration

941


What is primary key, unique key, and foreign key?

1014


Is it important for a database administrator to understand the operating system and file access?

1041


What is the definition for sql server 2000?

1137


How to update a field in SQL after ALTERING a row?

1284


How to delete an existing row with delete statements in ms sql server?

1148


What are the different types of sub-queries?

1086


Does the unique constraint create an index?

1133


What are the disadvantages of primary key and foreign key in SQL?

1151


what are the reporting service components in SSRS?

169


How to execute stored procedure in select statement sql server?

1111


Explain error handling in ssis?

1070


what is database replicaion? : Sql server database administration

1268


What is xdr?

1041