One - One Code All

Blog Content

mysql字符串替换函数replace()

MySQL   2010-07-03 16:27:05

Update `table_name` SET `field_name` = replace (`field_name`,’from_str’,'to_str’) Where id = ?

where 后面自行替换条件。务必要精确,别更新了不应该更新的数据。

说明:
table_name —— 表的名字
field_name —— 字段名
from_str —— 需要替换的字符串
to_str —— 替换成的字符串


上一篇:使用BatchPreparedStatementSetter 完成批量插入数据的操作
下一篇:R语言中cbind和rbind区别

The minute you think of giving up, think of the reason why you held on so long.