Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What are the advantages of user-defined functions over stored procedures in sql server?

1047


What happens if ntwdblib.dll is missing on your machine?

1145


How do we know if any query is retrieving a large amount of data or very little data?

978


Is it important for a database administrator to understand the operating system and file access?

1002


What do you understand by triggers and mention the different types of it?

945


Explain about system stored procedure?

1037


What area unit the various kinds of info compression introduced in sql server 2008?

1099


How to Insert multiple rows with a single insert statement?

1057


Data table as parameter in sql server?

1050


Where are sql server usernames and passwords stored in the sql server?

1117


What is self join in sql server joins?

1064


What is read uncmmited?

1063


what is normalization? Explain different levels of normalization? : Sql server database administration

1333


What are ddl triggers and types of ddl trigger?

1040


You want to implement the one-to-many relationship while designing tables. How would you do it?

962