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
what are constraints? Explain different types of constraints? : Sql server database administration
What is user-defined function?
Is it possible to update the views? If yes, how, if not, why?
What happens on checkpoint?
How to write a query with an inner join in ms sql server?
What is global temp table?
Explain how does the report manager work in ssrs?
Explain magic tables in sql server?
What are the steps to follow to configure SQL*Net?
What is the difference between for xml raw and for xml auto?
What is partition in sql server?
Do you know the different ddl commands in sql?
What is save transaction and save point?
What is report server project?
can any body tell me how to know the password of current user in sql server