mysql update 字段(字符串)中的部分数据
A | ||
---|---|---|
id | 1 | 2 |
name | 中文 | 英文 |
str | 英文234234324 | rwerwerwedsdfsdf |
update a set str = replace(str,’英文’,’中文’) where id = 1;
//如果数据是json字符串
可以使用 JSON_SET
A | ||
---|---|---|
id | 1 | 2 |
name | 中文 | 英文 |
str | 英文234234324 | rwerwerwedsdfsdf |
update a set str = replace(str,’英文’,’中文’) where id = 1;
//如果数据是json字符串
可以使用 JSON_SET