• The solution I provided might help. But, as said by other posters, the data structure is required. I posted on my assumption that;

    B is descendent of A

    E and F are Decendents of B

    C is decendent of A

    and

    D is decendent of C

    Now asuming this, I understood that if the OP queries B, he/she needs to get the complete hirarchy from B and its decendents and its decendents' decendents and so on....

    I hope the same thing was required...

    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Sometimes, winning is not an issue but trying.
    You can check my BLOG
    [font="Arial Black"]here[/font][/url][/right]