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 configure and test odbc dsn settings?
Write a query to include a constraint, to check whether the employee salary is greater than 5000?
What is PROJECTION Operation?
Can anyone tell that the extra features are there in SQL SERVER 2008 that are not available in previous versions .
how you can deploy an ssrs report?
How to run sql server 2005 books online on your local system?
How many types of cursor type are there?
How to create a stored procedure with a statement block in ms sql server?
Are semicolons required at the end of sql statements in sql server 2005?
Why is there a performance difference between two similar queries where one uses union and the other uses union all?
What is the difference between join and inner join?
How to populate a table in sql server?
What are the differences in Clustering in SQL Server 2005 and 2008 or 2008 R2?
What is a bit datatype?
What is a data source or ds? : sql server analysis services, ssas