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
What are the advantages of using third-party tools?
Do you know what is fill factor and pad index?
Define outer join?
How does a profiler work?
What is the purpose of floor function?
What is factless fact table? : sql server analysis services, ssas
Explain about Joins?
How do I determine how many instances of sql server are installed on a computer?
Explain what is the purpose of sql profiler in sql server?
How do you manipulate data?
How to assign null values to variables or columns?
Explain what is the function of sql server agent windows service?
how to trace the traffic hitting a sql server? : Sql server database administration
What is the purpose of the model database?
What is a collation?