1. 程式人生 > >update時concat和replace的用法

update時concat和replace的用法

①concat在原有的基礎上追加內容(追加)

sql 語句:update 表名 set title=concat( title, '123') where id=1;

結果   id   title

    1     abc

更新後   1     abc123

②replace 替換原有欄位內容裡的值  (僅僅替換)

sql 語句:update 表名 set title=replace( title, '模板', '版') where id=1;

結果  id     title

    1   中文模板

更新後 1     中文版