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
Mention the differences between sql server and mysql.
What is ems sql management studio? : sql server management studio
Give some Scenario for Non Clusterd index? Can we write system defined functions in side The Function? Wat is the Unique Datatype?
What is join query?
Hi all, can any one please tell me the difference between sql server 2008 and orace 9i
What are the types of indexing?
please differentiate between delete and truncate?
how you can configure a running aggregate in SSRS?
What are cursors and when they are useful?
What happens when converting big values to integers?
What are the pros and cons of putting a scalar function in a queries select list or in the where clause?
What is the difference between value type and reference type?
When columns are added to existing tables, what do they initially contain?
How many types of functions are there in sql server?
What is the difference between commit and rollback?