F
Flavelle Ballem
Given a table with the following:
ID : int (autonumber)
ParentID: int (nullable)
Information: string
....
and a self-join, where if a record has a Parent, then the ID for the Parent
is contained in ParentID,
I would like to write a query that will 'walk up the tree' - adding
information from all parents in order until (and including) the Parent that
does not have a Parent.
for example:
ID ParentID Information
1 null Record 1
2 null Record 2
3 1 Record 3
4 3 Record 4
I would like to be able to make a string reading "Record 1, Record 3, Record
4" for Record 4 by walking up the tree to Record 1.
Suggestions would be most welcome.
Many thanks,
Flavelle
ID : int (autonumber)
ParentID: int (nullable)
Information: string
....
and a self-join, where if a record has a Parent, then the ID for the Parent
is contained in ParentID,
I would like to write a query that will 'walk up the tree' - adding
information from all parents in order until (and including) the Parent that
does not have a Parent.
for example:
ID ParentID Information
1 null Record 1
2 null Record 2
3 1 Record 3
4 3 Record 4
I would like to be able to make a string reading "Record 1, Record 3, Record
4" for Record 4 by walking up the tree to Record 1.
Suggestions would be most welcome.
Many thanks,
Flavelle