I have inherited a table that contains a column that is used to "chain" between various related rows within the same table.
For instance: id, bar, reference_id
- 1, 'foo', 2
- 2, 'foo', 3
- 3, 'foo'
I have no idea what to call this structure in order to search for how I should deal with it. The idea is that the table maintains a sort of living history within itself. (my problem is that I may have row 1 or 2, but I need to get to row 3 somehow that is agnostic to the number of 'levels' that I need to traverse)