Home >Database >Mysql Tutorial >mysql字符串替换_MySQL

mysql字符串替换_MySQL

WBOY
WBOYOriginal
2016-06-01 13:02:04962browse

我现在有这样一个需求:在数据中有一个字段的数据形如“0-300”现在需要将数据替换成“0~300”。
解决的sql如下:UPDATE tj_item_result SET reference_range=REPLACE(reference_range,'—','~') WHERE reference_range LIKE '%—%'

执行完之后,所有数据都变成了我想要的数据了。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn