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 / rakesh ameta

create table newq(ids numeric(5),sname nvarchar(10),city nvarchar(10))

select * from newq where newq.ids in(select top 10 ids from newq x where newq.city=x.city)

Is This Answer Correct ?    0 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the minimum and maximum number of partitions required for a measure group? : sql server analysis services, ssas

1099


How do we know if any query is retrieving a large amount of data or very little data?

1032


What is a deadlock and what is a live lock?

1040


What is a covered index?

985


What is delete query?

990


What is report rendering ?

162


How can you insert values in multiple rows using one Insert statement?

1148


How to Improve the performencs of SQL Server 2005 exclude stored Procedure and Indexes?

2058


What is simple indexing method?

1083


What the difference between UNION and UNIONALL?

1086


What does the update command do?

1173


why would you call update statistics? : Sql server database administration

1157


Explain acid?

1141


Explain what are the different index configurations a table can have?

1160


How to test subquery results with the exists operator?

1163