I have 2 tables: table1
,table2
Parent Child Point Parent Total
a b 100 a 0(default) (result = 1050)
b c 200 b 0 (result = 950)
c d 250 c 0 (result = 750)
d e 500
The result in table2
should be sum of the children points based on parent in table1
.
a---b---c---d---e
I tried many times but cant figure out.
UPDATE table2 set Total=???