i have two table
Table 1:Master
Table 2: Slave
Master Table Definition Slave Table Definition
mID--label-----ParentID ID-----Label----mID----Amount
1---A----------Null 1------X--------1------20
2---B-----------1 2------Y--------1------30
3---C-----------1 3------Z--------2------20
4---D-----------2 4------X1-------4------50
5---E-----------4 5------X2-------5------100
Relation From Master table Relation from slave table
A=B+C A=X+Y
B=D B=Z
D=E D=X1
E=X2
Now,
How to sum up the tree of a master with slave table
A=(E+D+B)+C
therefore, A=sum of the value of(X2+X1+Z)
B=(D+E)
therefore, B=X1+X2
1 Answer