mysql 批量在某个字段前追加字符
29 June 2016
完整sql
update
xs_book
set
book_sign=replace(book_sign, book_sign, concat('vip ', book_sign))
where
book_sign not like 'vip%' and id > 90000
函数解释
- replace
update 表 set 字段=replace(字段,'原始串','替换串')
- concat 字符拼接
update 表 set 字段=concat(追加字符, 字段)