Hello All,
How do you query a nested set model with multiple roots, such trees in the same table? Currently, I added an extra column called the "Root" indicating the ID of the root node for all sub-tree nodes, however, I can't figure out the sql to retrieve them in the proper order
I'm referring to this article
Normally, the query to retrieve the items out in order is by order the left leaf value, but with multiple roots, you can end up with multiple "left:1" one after another, such break the tree.
I'm currently using a solution completely not related to sql. I re-arranged them in my C# code, but I'm just wondering if there is a way to do it with sql and such save the time I spent on the web server
One last question. If I have a filter and it filters out some data out of the tree, how do you deal with it?
Say
Task 1 (In progress)
Task 2 (Active)
Task 3 (Active)
if the filter is to show all tree with status "Active", what do you do?
Thanks a lot