Please give me query to display hierarchy

  • I have one table named "ut_Sections" with fields

    Section_ID, Name,IsParent(bit),PrentSection_ID

    Now i should display the hierarchy like:

    ParentSection_1

           ChildSection_1

                  SubschildSection_1

            ChildSection_2

             ChildSection_3

                     SubchildSection_2

                     SubChildSection_3

    ParentSection_2

    ParentSection_3

               ChildSection_4

                       SubchildSection_4

             ................etc

    i should display like this...how can i design the table and and query...please help me.

  • Lookup "hierarchical information" in Books on Line for an example.  Has a bug in it but shouldn't be hard for you to find.

    --Jeff Moden

    --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)

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply