0

I have no idea if what I'm looking for has a proper name or common way of addressing. I have a table with 2 columns. 1st one is a key, other one one match of that key :

key-match

1 - 2
1 - 3
2 - 3
3 - 5
...

What I'd like to generate is a list of grouped chains. For instance, in my data, there can be 10 lines with 1 as a key and 1 different match per row. BUT, if 1 matches with 2,3 and 3 matches with 5 and 5 matches with 16, the actual line should be :

1,2,3,5,16

In other words : all values that have a match, even non direct, should be grouped

I have absolutely no idea of how to achieve this, any help will be welcome !

Martijn
  • 15,791
  • 4
  • 36
  • 68
Vincent Monteil
  • 568
  • 5
  • 22

0 Answers0