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
When to use Inner join & when to use subquery?
Explain the stored procedure?
Explain about extended stored procedure?
Can you explain powershell included in sql server 2008?
Explain about Views?
How can you start sql server in different modes?
Why union all is faster than union?
what are acid properties? : Sql server database administration
What is the use of RDBMS?
Explain sub-query?
What does <> symbol mean?
What is update_statistics command?
What are advantages of ssrs or why we should use ssrs?
Explain what is lock escalation and what is its purpose?
Can a function call a stored procedure in sql server?