I've used nested sets methodology proposed by Celko to create a tree for calculating MLM commissions. I need to find if any node meets certain characteristics (i.e. "rank") between the parent node and the terminating leaf node, when I do not know the left or right values of the leaf node or how many nodes are between the parent and the leaf.
Key fields are:
lft
rgt
idNumber
rank
Any suggestions? I am wrting in ASP using mySQL as database.
I could alternatively work from down up (in which I would know the leaf node) but need to find the first instance above the leaf node that meets the rank qualifications.
Thanks in advance for your help.