Home Forums Programming General Hierarchy without cursor/loop RE: Hierarchy without cursor/loop

  • ansaryarshad - Monday, March 20, 2017 12:01 PM

    Hi Thom,

    Thanks for the post . But the condtion

    E.MgrID = H.EmpID
     will not work for Node C as its Parent Node is B which is not in H table

    BR
    Arshad

    Did you actually try running the code?  Seems to work for me.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)