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
Explain the commands in sql server?
Are connections to sql server encrypted?
Can an entity have two primary keys?
What are different types of replication in sql server?
Tell me what is a linked server?
How to retrieve field values using mssql_result()?
What is the difference between having clause and where clause in sql server?
How to perform key word search in tables?
How can I tell if sql server is 32 or 64 bit?
Explain boyce and codd normal form(bcnf)?
Mention the different authentication modes in sql server.
What is indexing in sql server with example?
Differentiate between a having clause and a where clause.
Can you please differentiate between a primary key and a unique key?
What is sql azure database?