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 / rakesh ameta
create table newq(ids numeric(5),sname nvarchar(10),city nvarchar(10))
select * from newq where newq.ids in(select top 10 ids from newq x where newq.city=x.city)
Is This Answer Correct ? | 0 Yes | 2 No |
Post New Answer View All Answers
What is resource db in sql server?
What is data modeling and Reterminal integrity?
hi i am working as a testengineer , so i want to no the backend data base connection can any one tell mwe in detail
Define candidate key, alternate key, and composite key.
Can you explain different types of joins?
How do I view a procedure in sql server?
What is pessimistic concurrency?
Explain trigger and its types?
What are click through reports?
How to write a query with a right outer join in ms sql server?
How do I open a .db file?
How can I tell if sql server is 32 or 64 bit?
What are the drawbacks of reporting in ssrs?
How you can minimize the deadlock situation?
We need to perform what steps in the following order to work with a cursor?