Hi together, there's spaghetti in my head. I have the feeling like it should be possible, but can't figure out how to.
I've a table like this
| A | B |
| 0 | NULL |
| 1 | 0 |
| 2 | 1 |
| 3 | 1 |
| 4 | 1 |
| 5 | 1 |
Column A contains the case key, B can contain a case key as a reference. E.g. case 1 refers to case 0. And the cases 2, 3, 4, and 5 refer to case 1.
Now I want to "turn around" the reference so that there is a new column that shows e.g. for case 1 that it's referenced by 2, 3, 4, and 5. The result should look like this:
| A | B | C |
| 0 | NULL | 1 |
| 1 | 0 | 2, 2, 3, 4 |
| 2 | 1 | NULL |
| 3 | 1 | NULL |
| 4 | 1 | NULL |
| 5 | 1 | NULL |
Any ideas?