Mysql string replacement _ MySQL

Source: Internet
Author: User
I have the following requirement: the data with a field in the data is like 0-. now I need to replace the data with 0 ~ 300. The SQL statement is as follows: UPDATEtj_item_resultSETreference_rangeREP I have the following requirement: there is a data field in the data, for example, "0-". now we need to replace the data with "0 ~ 300 ".
The SQL statement is as follows: UPDATE tj_item_result SET reference_range = REPLACE (reference_range ,'-','~ ') WHERE reference_range LIKE' %-%'

After the execution, all the data is changed to the data I want.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.