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 2005 Forums
 Transact-SQL (2005)
 Sueqntially Numbered Subsets

Author  Topic 

jpizzolato
Starting Member

1 Post

Posted - 2008-03-25 : 12:31:05
I have a table that is created based on a heirarch of set criteria and need to number the subsets within. The best way to illustrate what I want to accomplish is through an example.

Rank | Item_1 | Item_2 | Class
---- | ------ | ------ | ------
1 | 1A | 1B | ExactMatch
2 | 1A | 1C | Sub
3 | 1A | 1D | Sub
1 | 2B | 2F | ExactMatch
2 | 2B | 2G | Sub

Is there a way to accomplish this? Any help or suggestions are appreciated.

I apologize for the formatting, but I think you should be able to get the point.

thanks,

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2008-03-25 : 12:39:45
Ok - that's the desired result, what is the starting point look like?

Be One with the Optimizer
TG
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-03-25 : 14:25:36
How do you want to rank them? on what basis? Please explain with help of some sample data
Go to Top of Page

LoztInSpace
Aged Yak Warrior

940 Posts

Posted - 2008-03-25 : 19:31:18
Check out the RANK/DENSE RANK functions
Go to Top of Page
   

- Advertisement -