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
How to use clusters?
Give me any three differences between Truncate and Delete.
What is global temp table?
How to round a numeric value to a specific precision?
How to enable tcp/ip protocol on a sql server?
Tell me what do you mean by an execution plan? Why is it used? How would you view it?
Explain about Joins?
Tell me what are the advantages of using stored procedures?
Name three of the features managed by the surface area configuration tool? : sql server security
Explain index in sql server?
What is clustered index
What is sql server management studio? : sql server management studio
Does dbcc checkdb requires db to be in single_user mode? : sql server database administration
How to get a list of columns in a view using the "sp_columns" stored procedure?
List some advantages and disadvantages of stored procedure?