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 are different types of join?
What is it’s similarity with sql server?
What are the differences between substr and charindex in sql server.
How to optimize stored procedures in sql server?
How to attach adventureworkslt physical files to the server?
What is scheduled job and how to create it?
Using the customer, and order table in northwind database, please write a query to produce xml?
Do you know what are the restrictions that views have to follow?
What is dimension table? : sql server analysis services, ssas
You want to use bids to deploy a report to a different server than the one you chose in the report wizard. How can you change the server url?
What is the sql server agent?
how to create “alternate row colour”?
Where are SQL server users names and passwords are stored in sql server?
your distribution database is full what will u do
How do I find my localdb version?