I have a table t1:
Id Period Cap_Up Cap_Down
=============================
1000 1 100 200
1000 2 500 600
1001 1 200 400
1001 2 300 150
1002 1 900 500
1002 2 250 600
I want columns Cap_Up and Cap_Down be updated for Id=1000 based on values of these column for Id=1001 and Id=1002, for all periods, as follows:
Cap_Up(1000) = Cap_Up(1001) + Cap_Down(1002)
Cap_Down(1000) = Cap_Down(1001) + Cap_Up(1002)
So, the output will be, t1:
Id Period Cap_Up Cap_Down
=============================
1000 1 700 1300
1000 2 900 400
1001 1 200 400
1001 2 300 150
1002 1 900 500
1002 2 250 600