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
 SQL Server Development (2000)
 How to compare rankings

Author  Topic 

yxiong
Starting Member

4 Posts

Posted - 2002-06-13 : 14:54:00
Dear all, You've helped me with some difficult queries, here's another one:

I have a relational database with an Employees table and a Terms table. Each employee belongs to a site (Atlanta, New York, etc.). The Terms table stores products. I want to write a stored procedure that will get the top 5 products for a specific site and also return what that product is ranked for the other 4 sites.

So for example the Term "Location" may be ranked #1 for Atlanta but may rank #8 for New York. Is this possible?



robvolk
Most Valuable Yak

15732 Posts

Posted - 2002-06-13 : 15:18:42
quote:
So for example the Term "Location" may be ranked #1 for Atlanta but may rank #8 for New York. Is this possible?
Not without the full table structures for each table, some sample data, and examples of the output you want. Until you post all of these there's nothing we can do.

Go to Top of Page
   

- Advertisement -