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 ? | 1 Yes | 5 No |
Post New Answer View All Answers
What is a collation?
tell me what is blocking and how would you troubleshoot it? : Sql server database administration
What is primary key, unique key, and foreign key?
Is it important for a database administrator to understand the operating system and file access?
What is the definition for sql server 2000?
How to update a field in SQL after ALTERING a row?
How to delete an existing row with delete statements in ms sql server?
What are the different types of sub-queries?
Does the unique constraint create an index?
What are the disadvantages of primary key and foreign key in SQL?
what are the reporting service components in SSRS?
How to execute stored procedure in select statement sql server?
Explain error handling in ssis?
what is database replicaion? : Sql server database administration
What is xdr?