【mysql】MYSQL中批量替换某个字段的部分数据

来源:互联网 发布:mysql解压版安装配置 编辑:程序博客网 时间:2024/05/22 13:28

MYSQL中批量替换某个字段的部分数据

 

1.修改字段里的所有含有指定字符串的文字

UPDATE 表A SET 字段B = replace(字段B, 'aaa', 'bbb')

    example: update  `table` set `url`= replace('url', 'aaa', 'bbb')  【将url字段中的aaa批量更改为bbb】

     
2.常规条件修改:
update table set column='' where column is null 
列:update  `table` set `url`='0' where `url` is null 
0 0
原创粉丝点击