Click here to Skip to main content
15,886,806 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi i need to calulate total downline in mlm software i know it can be achived using recursion query but have no any indea about it
my table is like
userid sponser_id position left right
1 0 0 0 0
2 1 left 1 0
3 1 right 0 1
4 1 right 0 1
5 2 left 1 0
ok now for n number of users they can have one sponser id and position left or right
but for actual position in tree he can have a position id and on left or right
tail id is important as tree will be created using tail id and calculating whole business downline
but to calculate exact commission pairs will be calulated on sponser id
what i need is when u ask tree for a specific user let it be id 1
then on right side there will userid 2 and then on his left and right side other users n on n on... so how can i calulate that ?
the out put should be:
1
2 3

4 5 6 7
Posted

1 solution

If itz an institute problem, plz don't post it here. Itz for industry issues.
 
Share this answer
 
Comments
manjunath NIE 9-Dec-11 0:07am    
If U dont know then dont answer.............

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900