4

msyql 数据批量替换replace

 2 years ago
source link: https://www.80shihua.com/archives/2483
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

msyql 数据批量替换replace

作者: dreamfly 分类: mysql 发布时间: 2020-05-25 18:23

有时候我们在数据插入之后,会发现数据有问题,这个时候一般有两种解决办法,一种就是通过程序批量修改,一种就是通过mysql直接进行数据的替换。

replace

replace(object,search,replace)

repalce是mysql提供的默认字符串处理函数,根据函数定义,我们只需要传入对应参数即可。

insert into `test` set name = 'menghuiguli-666';
update `test` set name = repalce(name,'-','_') where id = 1;

如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!

发表评论 取消回复

您的电子邮箱地址不会被公开。 必填项已用*标注


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK