I have two tables with identical columns ID
, A
, B
, C
.
I need to ADD to TableX
the values from TableY
for the corresponding ID
's. I know how to do this for a SINGLE update as follows:
update TableX x
set x.A= x.A +
(select y.A
from TableY y
where x.id= y.id)
where exists (select y.id
from TableY y
where x.id = Y.id).
But how to modify this statement so that I can update multiple columns as sums?
TIA