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 / asim

select id,addressid,city
from
(
SELECT ROW_NUMBER() OVER (partition by city Order by
addressid) ID,AddressID,City
FROM person.Address A
WHERE City IN
(select city from person.address group by City

) )a
where a.ID <11
order by City,ID

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the security related catalog views? : sql server security

914


What are the types of resultset?

917


Explain what is the use of custom fields in report?

872


what are isolation levels? : Sql server database administration

913


Which operator do you use to return all of the rows from one query except rows are returned in a second query?

946


How to convert numeric expression data types by assignment operations?

1004


how to avoid cursors? : Sql server database administration

906


What is difference between Datepart() and Datename() in SqlServer?

1158


What is the difference between composite index and covering index?

902


What do you understand by triggers?

862


What is partition in sql server?

977


What are the different types of lock modes in sql server 2000?

884


What is a performance monitor?

923


What are the purpose of Normalisation?

1002


How to check status of stored procedure in sql server?

914