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 ?    2 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are drillthrough reports?

149


What is difference between index seek vs. Index scan?

1106


What is ms sql server index?

1045


Disadvantages of the indexes?

1070


What is recompile sql server?

1002


What are the dmvs? : sql server database administration

1022


How do you create a clustered index?

1023


What is parameterized reports in ssrs ?

145


What is log in sql server?

1103


What is the Control Flow in SSIS

1050


What do you understand by sql server agent?

929


Explain tables in SQL Azure?

120


what is sql server? : Sql server database administration

949


What is tempdb database? : SQL Server Architecture

1140


What happens when converting big values to numeric data types?

1064