mysql中的替换语句
2007-02-08 16:06
330 查看
如下:
update users_settings set `ConfigValue` = replace(configvalue,' fromstr' ,'tostr') where `ConfigName`='accesslist'
将comment表中的author_url包含www.sohu.com的记录,其中的sohu替换为sina,一个语句搞定~
update comment set author_url=REPLACE(author_url,'sohu','sina') where author_url REGEXP 'www.sohu.com';
带IF判断的复杂替换
update comment set url=IF(url REGEXP 'test.yahoo.com.cn',REPLACE(url,'www1.sohu.com','www.sina.com'),REPLACE(url,'www2.yahoo.com','www.sina.com')) where 1=1;
update users_settings set `ConfigValue` = replace(configvalue,' fromstr' ,'tostr') where `ConfigName`='accesslist'
将comment表中的author_url包含www.sohu.com的记录,其中的sohu替换为sina,一个语句搞定~
update comment set author_url=REPLACE(author_url,'sohu','sina') where author_url REGEXP 'www.sohu.com';
带IF判断的复杂替换
update comment set url=IF(url REGEXP 'test.yahoo.com.cn',REPLACE(url,'www1.sohu.com','www.sina.com'),REPLACE(url,'www2.yahoo.com','www.sina.com')) where 1=1;
相关文章推荐
- mysql 语句批量替换字符串
- MySQL 替换某字段内部分内容的UPDATE语句
- mysql update正则替换sql语句
- replace MYSQL字符替换函数sql语句分享(正则判断)
- mysql部分替换sql语句分享
- mysql替换语句之字段值替换
- mysql 替换字符串语句
- DEDECMS 批量替换alt为空的文章为文章标题的MYSQL语句
- mysql替换表中的字符串的sql语句
- mysql查询替换语句
- mysql部分替换sql语句分享
- mysql中的替换语句
- MySQL 替换某字段内部分内容的UPDATE语句
- mysql替换语句之字段值替换
- 新广告法,极限词剔除,替换掉的mysql语句
- mysqlp批量替换的sql语句
- mysql查询替换语句
- 【MySql】sql语句--批量替换字符串
- mysql查询字符串替换语句小结(数据库字符串替换)
- mysql部分替换sql语句分享