amykhar
09-20-2005, 02:16 PM
I am working with a tree using the modified preorder tree.
http://www.sitepoint.com/article/hierarchical-data-database/2
What I am looking for is an efficient way to count things that are held in each node of the tree.
In other words, each node of the tree is a container. And each container has a number of things in it. I need to be able to count the things in such a way that the count of things in the parent nodes includes the number of things in the child nodes.
I know how to find all the child nodes. I know how to find the parent nodes. But, I am looking for an efficient way to query the database to get the count right.
Any thoughts?
http://www.sitepoint.com/article/hierarchical-data-database/2
What I am looking for is an efficient way to count things that are held in each node of the tree.
In other words, each node of the tree is a container. And each container has a number of things in it. I need to be able to count the things in such a way that the count of things in the parent nodes includes the number of things in the child nodes.
I know how to find all the child nodes. I know how to find the parent nodes. But, I am looking for an efficient way to query the database to get the count right.
Any thoughts?