select hierarchy of id's from single table

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vjayis
    New Member
    • Mar 2008
    • 134

    select hierarchy of id's from single table

    hi

    i m having an table named users.

    the column names are id,name,referal ID,amount etc...

    each user has an referalID.

    so when a new row is inserted i need to update the amount of the referalID by an percentage and their referalID amount by an percentage upto 5levels..

    how to select those hierarchy of id's in an query..

    thanks
    regards
    vijay
Working...