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 verify the port number of the sql server?
What are the components of dbms?
How to use go command in "sqlcmd"?
how can you check the level of fragmentation on a table? : Sql server administration
What is the use of floor function in sql server?
What is the need for indexing?
What are the different SQL Server Versions you have worked on?
how many layers of tcp/ip protocol combined of? : Sql server database administration
Explain insert into select statement?
What is clustered vs nonclustered index?
When a primary key constraint is included in a table, what other constraints does this imply?
Define outer join?
What are the reporting services components?
Do you know what is replace and stuff function in sql server?
What is stored procedures?