M
mscertified
Table structure:
ID
Item
ParentID (points to ID)
I need a query that will return me every combination of
ParentID and ID for every level in the structure, e.g.
Data
1 A 0
2 B 1
3 C 2
Will return:
1 2
1 3
2 3
In other words if this were a family tree, I need to be able to find out all
of a persons ancestors and all their descendents.
Solution must work no matter how many levels there are.
Any help appreciated.
ID
Item
ParentID (points to ID)
I need a query that will return me every combination of
ParentID and ID for every level in the structure, e.g.
Data
1 A 0
2 B 1
3 C 2
Will return:
1 2
1 3
2 3
In other words if this were a family tree, I need to be able to find out all
of a persons ancestors and all their descendents.
Solution must work no matter how many levels there are.
Any help appreciated.