Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Returning top 5 sales regions for part list

Author  Topic 

crispbd
Starting Member

2 Posts

Posted - 2005-05-06 : 12:16:29
I want to return a list of items, but for each item, list the
top 5 matches for a criteria (say.. sales regions) how do i do this? I've tried using the 'top' keyword but find it difficult to have it applied to every part in the list.

Here is the basic result set that I'm looking to generate:

Item Region

item1 Canada
item1 Germany
item1 Sweden

item2 Germany
item2 France
item2 Russia

etc.

X002548
Not Just a Number

15586 Posts

Posted - 2005-05-06 : 12:18:35
Well, there's always this

http://weblogs.sqlteam.com/brettk/archive/2005/02/10/4153.aspx



Brett

8-)
Go to Top of Page

crispbd
Starting Member

2 Posts

Posted - 2005-05-06 : 12:47:26
Thanks a lot!
Go to Top of Page
   

- Advertisement -