Re: MySQL query
Quote
... in the end all data from column a has to added to column b and then column a should be null. How can we achieve it ?
Defined "added".
1. Value of b
overwritten with value of a?
2. Value of a
numerically added to the value of b?
3. Value of a concatenated to the value of b?
4. (Something else)
update table1
set
column_b = column_a -- (case 1)
, column_b = column_b + column_a -- (case 2)
, column_b = concat( column_b, column_a ) -- (case 3)
, column_a = NULL -- (All Cases)
;
Of course, wrap this in a
Transaction so you get everything (or nothing) done in one.
Regards, Phill W.
Subject
Written By
Posted
Re: MySQL query
October 12, 2022 06:41AM
Sorry, only registered users may post in this forum.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.