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 / 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


Please Help Members By Posting Answers For Below Questions

What is the difference between dbcc indexdefrag and dbcc reindex?

932


What is model database in sql server?

1004


Can You Use A Stored Procedure To Provide Data To An Ssrs Report?

139


How to update values in a table with update statements in ms sql server?

960


Is BCNF better than 2NF & 3NF? Why?

1003


What do you mean by an execution plan? Why is it used? How would you view it?

880


How will you go about resolving deadlocks?

912


What is in place upgrade in sql server?

990


What is a partition function in sql server?

1024


Explain what is public role in sql server?

1060


How to check status of stored procedure in sql server?

914


What are the new data types are introduced in sql 2000?

862


What are the mathematical functions supported by sql server 2005?

998


How do I clean up sql server transaction log?

995


What is tcl in sql server?

1080