I have a design problem while creating a procedure.
Suppose I have to update all rows in a table using data in other columns in same row. Say table1
has 3 columns A
, B
and C
and I need to update all rows as C=A+B
. So I can use:
update table1 set C=A+B;
But I need to do this using something like below:
merge tab1e1 using (some query) on (some condition)
when matched update
C=A+B
when not matched
null;
Is there a way of doing this by manipulating 'some query' and 'some condition'?