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

Explain Capacity planning to create a database? and how to monitor it?

4207


What does it mean to be in union?

937


Explain forward - only cursors?

1078


What is SQL Azure Data sync?

121


What is SQL Azure Firewall?

136


What is a database table?

980


How can you find out how many rows returned in a cursor?

1032


What is the temp table?

929


 Explain what is sql override for a source taLle in a mapping?

1015


What are the different types of data sources in ssrs?

196


What is normalization according to you and explain its different levels?

957


What is always encrypted?

1006


Stored Procedure returns data from multiple tables. How to access it in your ASP.Net code?

1065


What is best institute to Learn DotNET And SQL in chennai?

2164


What are the main differences between #temp tables and @table variables and which one is preferred?

1088