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
Explain Capacity planning to create a database? and how to monitor it?
What does it mean to be in union?
Explain forward - only cursors?
What is SQL Azure Data sync?
What is SQL Azure Firewall?
What is a database table?
How can you find out how many rows returned in a cursor?
What is the temp table?
 Explain what is sql override for a source taLle in a mapping?
What are the different types of data sources in ssrs?
What is normalization according to you and explain its different levels?
What is always encrypted?
Stored Procedure returns data from multiple tables. How to access it in your ASP.Net code?
What is best institute to Learn DotNET And SQL in chennai?
What are the main differences between #temp tables and @table variables and which one is preferred?