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
How to use "if ... Else if ... Else ..." Statement structures in ms sql server?
What do you need to connect php to sql server?
Is it possible to import data directly from t-sql commands without using sql server integration services? If so, what are the commands?
What are the types of indexing?
Do you know what is raid and what are different types of raid configurations? : SQL Server Architecture
What are the difference between “where” and “having” clause in sql server?
Tell me what do you understand by a view? What does the with check option clause for a view do?
What different steps will a sql server developer take to secure sql server?
Explain different types of BACKUPs avaialabe in SQL Server? Given a particular scenario, how would you go about choosing a backup plan?
What is policy management?
When would you use the stored procedures or functions?
How to find out what is the default collation in a database?
What are wait types?
What is the Disadvantage of indexed sequential file.
Name three of the features managed by the surface area configuration tool? : sql server security