mysql update additional content field

Update encountered a scene of today, that is updated when a field value is not updated with the new values, but the original data appending.

The reaction is contemplated that the first update table set remark = 'additional content' + remark where id = ''; such an approach, i.e., the digital conceivable type of operation, is the direct subtraction may be performed,

However, since the field is varchar, after performing found remark value becomes 0, that is: if the value would have remark, and a character, this update is updated to 0, if the value is a number remark, will not maintain the original digital updated.

 

Thereby splicing think the character should concat, then re-edit sql:

update table set remark = concat ( 'new value', remark) where id = ''; write, update was successful.

Guess you like

Origin www.cnblogs.com/flysand/p/11352114.html