问题描述:
mysql varchar型字段中,替换字段中指定的部分字符串

解决方法:

使用replace(obj, search, replace_str)函数;

sql语法:

UPDATE 表名 SET 字段名=replace(字段名, '被替换字符串', '用来替换的字符串') ;

使用样例:

 UPDATE `member` SET `phone`=replace(`phone`, '\', '') ;
update item as t set 
t.share_descs=REPLACE(t.share_descs,'罗莱LOVO','LOVO')
 WHERE t.theme = '2c9280856efd0b23016efdacb45c0444'

 

相关文章:

  • 2022-12-23
  • 2021-08-03
  • 2021-05-23
  • 2021-06-12
  • 2022-12-23
  • 2021-09-21
猜你喜欢
  • 2021-07-24
  • 2021-06-17
相关资源
相似解决方案