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 / ravi kumar ravuri
select * from Customer where Customer_ID in (select top 10
from Customer Where City_name in ( select City_Name from
Customer Group by City_Name))
Is This Answer Correct ? | 0 Yes | 4 No |
Post New Answer View All Answers
How do I schedule a sql server profiler trace?
how you can configure a running aggregate in SSRS?
What is cte (common table expression)?
What is a with(nolock)?
Explain following error properties?
How to define and use table alias names in ms sql server?
What are the 7 disadvantages to a manual system?
What is the order in which the sql query is executed?
Explain filtered indexes benefits?
What are sql servers used for?
How to provide column names in insert statements in ms sql server?
What are window functions in sql server?
What is coalesce in sql server?
Define magic tables in sql server?
Difference between Sql server reporting services and Crystal reports?