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 / ravi kumar ravuri
select * from Customer where Customer_ID in (select top 10
from Customer Where City_name in ( select City_Name from
Customer Group by City_Name))
Is This Answer Correct ? | 0 Yes | 4 No |
Post New Answer View All Answers
How to check if a table is being used in sql server?
Does sql server 2000 full-text search support clustering?
What is the difference between functions and stored procedures?
What is recursion? Is it possible for a stored procedure to call itself or recursive stored procedure?
What is a recursive stored procedure in sql server?
If a user does not have permission to a table, but has permission to a view created on it, will he be able to view the data in table?
how to trace the traffic hitting a sql server? : Sql server database administration
What encryption security is available in sql azure?
Can you please explain the difference between primary keys and foreign keys?
ow to bring suspect mode datbase online from scratch
What is delete query?
How to drop an existing schema in ms sql server?
What is the meaning of sql server?
What is difference in performance between insert top (n) into table and using top with insert?
what is a live lock? : Sql server database administration