Good Afternoon,
I'm trying to find a query that will return a result set from a table that has the parent / child relationship in the same table. The table contains articles of information for a knowledge base application which is structured around a tree type interface. Each of the records contain a NodeId field (primary index) and a ParentId field that ties it to the related parent node.
So, what I need to do is be able to specify the NodeId and return a result set that contains that article, and all of the children, grandchildren, great-grandchildren, etc... Currently I'm doing it programatically by looping through each level of the children and requerying based on the NodeIds returned to get the next level. I'm hoping to simplify this with a query based solution if possible.
Any ideas would be greatly appreciated.
- Glen
Know thy data.
I'm trying to find a query that will return a result set from a table that has the parent / child relationship in the same table. The table contains articles of information for a knowledge base application which is structured around a tree type interface. Each of the records contain a NodeId field (primary index) and a ParentId field that ties it to the related parent node.
So, what I need to do is be able to specify the NodeId and return a result set that contains that article, and all of the children, grandchildren, great-grandchildren, etc... Currently I'm doing it programatically by looping through each level of the children and requerying based on the NodeIds returned to get the next level. I'm hoping to simplify this with a query based solution if possible.
Any ideas would be greatly appreciated.
- Glen
Know thy data.