MySQL在已有字段后追加相应的值值

需求:在MySQL中的topic表中,需要将每一个cover字段后添加上: -400.webp

update topic set cover = CONCAT(cover,'-400.webp') where atype = 2;


MySQL替换字段中的值

需求:如果在追加-400.webp的时候,错误的写成[-400.wep],需要替换掉错误的wep ---> webp

update topic set cover = replace(cover,'wep','webp')  where atype = 2;

说明:
    使用replace方法:
        args1 ---> 需要替换的字段
        args2 ---> 需要替换的字段中的值
        args3 ---> 替换后的值

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-25
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-29
  • 2021-06-02
猜你喜欢
  • 2022-12-23
  • 2021-05-19
  • 2021-11-09
  • 2022-02-13
  • 2022-03-06
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案