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 coalesce function?
what is a deadlock? : Sql server database administration
What is the primary use of the model database?
What are the transaction properties?
What is coalesce and check constraint in sql server?
Does hive support indexing?
What are the general features of sql server management studio? : sql server management studio
What are the new features in SQL Server 2005 when compared to SQL Server 2000?
What are the types of containers in ssis?
What are types of subqueries?
What options are there to delete rows on the publisher and not on the subscriber? : sql server replication
What are the differences between char and varchar in ms sql server?
What is the benefit of normalization?
What are functions in the sql server?
How many tables can be joined in SQL Server?