I have a table as follows, lets say TEMP
Desc_1 Desc_2 Score
a b 10
a c 10
x y 10
x z 10
a d 9
a e 9
a f 8
f g 8
I want the result as follows
a,b,c 10
x,y,z 10
a,d,e 9
a,f,g 8
So the first rules is all elements in a group should have the same score.
And how the grouping occurs is
1)There should be a direct relation that is a,b should be in the table TEMP
2)There could be an indirect relation that is a,g could be in the same group if there are entries in TEMP as [(a,f) and (f,g) ]or [(a,f) and (g,f))]
P.S. Sorry for the constant edits.