Oracle 10 how to update table as sum
I have two tables with the same columns ID
, A
, B
, C
.
I need to add to the TableX
values ββfrom TableY
for the relevant ones ID
. I know how to do it for SINGLE update like this:
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 do I change this statement so that I can update multiple columns as sums?
TIA
+3
source to share
3 answers