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

mysql字符串替换_MySQL

WBOY
Release: 2016-06-01 13:02:04
Original
976 people have browsed it

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

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template