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
How do you implement session management in SQL Server mode?
What do you understand by coalesce in sql server?
What are the purpose of Normalisation?
What is the dbcc command and why is it used?
What is difference between primary key and foreign key?
What do you understand by sql server agent?
Can we install sql server 2016 on windows 7?
what are the different types of SSRS reports?
How to connect sql server management studio express to sql server 2005 express?
What is the new security features added in sql server 2014? : sql server security
You have a table ‘test’ which is a copy of northwind employee table you have written a trigger to update the field ‘hiredate’ with the current date
What is the difference between set and select?
When does the auto update index statistics feature in sql server turn itself on?q) what specific conditions database should meet, before you can bulk copy data into it using bcp?
What is difference between Datepart() and Datename() in SqlServer?
Describe the functionalities that views support.