Here is the problem:
I have a representation of a tree. let's abstract this to the fullest and say this is the tree: (id, parent_id)
the root is a row with parent_id = null
I'd like to create a table that lists all the descendants of all parents.
For example:
The representation : (1,null), (2,1), (3,1), (4,2), (5,3), (6,3)
The result: (1,2), (1,3), (1,4), (1,5), (1,6), (2,4), (3,5), (3,6)