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
What is a virtual table in sql?
Does group by sort data?
What is scheduled job and how to create it?
Give me a SQL Query to find out the second largest company?
Can you pass expressions to function parameters?
Describe the left outer join & right outer join. : sql server database administration
What is statement level trigger?
List out the differences between global and local temp tables in sql server?
Can you name some of the dml commands in sql?
Explain transaction server explicit transaction?
What are the tools available in market as an alternative to sql server reporting services?
What is the difference between Triggers and Stored Procedure?
How to use copy and concatenate commands in SQL?
What is postgresql server?
what is a default tcp/ip socket assigned for sql server? : Sql server database administration