mysql的replace函数替换字符串
2009-01-13 13:51
323 查看
replace 函数即可批量改变某字段中的某一段字符串。 查 mysql 里的 replace 函数 update `xxx` set `a` = replace(`a` , '要替换的' , '替换为的') where xxx ===PHPCHINA.COM=============================================================== update `xxx` set `a` = replace(`a` , '要替换的' , '替换为的') where xxx update `music` set `file` = replace(`file` , '' , 'ddd') where id<10 UPDATE music SET file=REPLACE(file, '', 'def') where id < 10 ; ===mysql.com=============================================================== 用mysql的replace函数替换字符串 比如你要将 表 tb1里面的 f1字段的abc替换为def UPDATE tb1 SET f1=REPLACE(f1, 'abc', 'def'); REPLACE(str,from_str,to_str) 在字符串 str 中所有出现的字符串 from_str 均被 to_str替换,然后返回这个字符串: mysql> SELECT REPLACE('www.mysql.com', 'w', 'Ww'); -> 'WwWwWw.mysql.com' 这个函数是多字节安全的。 ================================================================== |
相关文章推荐
- 使用mysql的replace函数替换字符串
- Mysql的replace函数替换字符串
- 使用mysql的replace函数替换字符串
- MySQL replace函数替换字符串语句的用法
- 使用mysql的replace函数替换字符串
- 使用mysql的replace函数替换字符串
- Mysql:替换某个字段中的部分字符串——replace函数
- MySQL replace函数替换字符串
- mysql的replace函数替换字符串功能简介
- 使用mysql的replace函数替换字符串
- Mysql字符串中字符替换
- mysql中使用REPLACE函数替换字段中部分字符
- str_replace函数-字符串替换
- mysql 替换函数replace()实现mysql 替换字符串
- mysql中替换字符串(正则) 模糊
- mysql替换字段里数据内容部分字符串
- mysql 批量修改(替换) 指定 字符串字段
- mysql 替换字符串
- 【Mysql】用replace替换字符串进行条件搜索和排序
- mysql使用REPLACE替换字段里数据内容部分字符串