I am trying to remove the need to perform multiple SQL queries to get a long winded list of parent node relationships from a table.
I have a table that contains a list of the parent-child relationships, but would ideally like to create a view to expand this further.
For example, if I have a Tree such as:
a - b
c - d
f - d
This could be represented in a table of links where
it is possible for a child to have more than one parent as this simply a link from one point to another and not designed to be a structured tree.
What I would like to see is essentially a view containing all the nodes and ALL their children
For the example above, this would give:
With this, I can simply select where Node is 'a' and know that b, c, d and e are children (not necessarily direct)
I have included a null entry for the node itself so that there is always at least one entry for every node.
This is not necessary, or could even be the node itself (i.e. f - null could be f - f)
Any ideas on how I can achieve this?