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 / abhijith
select top 10
from tablename
where city IN
(select distinct(city) from tablename)
| Is This Answer Correct ? | 2 Yes | 6 No |
Post New Answer View All Answers
What is a mixed extent?
When columns are added to existing tables, what do they initially contain?
How to convert numeric expression data types using the cast() function?
What is nonclustered index with included columns ?
what are the types of indexes? : Sql server database administration
Tell me what is normalization? Explain different forms of normalization?
Can I work with several databases simultaneously? : sql server management studio
What are the benefits of normalization?
How can you manage sql azure security?
Difference between uniqe index and uniqe constraint?
where can you add custom error messages to sql server? : Sql server administration
What is use of attribute hierarchy optimized state? : sql server analysis services, ssas
What is use of except clause? How it differs from not in clause?
What are the disadvantages of primary key and foreign key in SQL?
What is “begin trans”, “commit tran”, “rollback tran” and “savetran”?