How to find top parentid in a table where the table is like a tree structure

  • hi

    Thanks a lot for giving your valuable time in solving the problem. But what i need is i want the tree elements above 70 in one temptable and below elements like 80,90 in another temp table.

    can u pls give me solution for this.

    Thanks,

    sainath

  • I didn't realize your top level had a parent ID equal to its Individual ID. You'll need to add a test for that to the Where clause.

    To put them in separate temp tables, just split up the two CTEs into two separate queries.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

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

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