mysql替换表的字段里面内容,如例子: mysql> select host,user from user where user='testuser'; +-----------------------+----------+| host | user |+-----------------------+----------+| localhost.localdomain | testuser | +-----------------------+-
解决:使用replace(obj, search, replace_str)函数; sql语法: UPDATE 表名 SET 字段名=replace(字段名, ‘被替换字符串’, '用来替换的字符串') ; sql: UPDATE `member` SET `phone`=replace(`phone`, '\'', '') ; update item as t set t.share_descs=REPLACE(t.share_descs,'罗莱LOVO','LOVO') WHERE t.th