Home > Database > Mysql Tutorial > body text

MySQL 批量替换之replace语法的使用

WBOY
Release: 2016-06-07 17:06:35
Original
803 people have browsed it

实际需求中,需要对某张表某字段里面的内容进行批量替换,普通的思考流程如下: SELECT出来 str_replace替换 UPDATE写入 实际这

实际需求中,需要对某张表某字段里面的内容进行批量替换,普通的思考流程如下:

SELECT出来

str_replace替换

UPDATE写入

实际这样极其浪费资源以及消耗资源,MYSQL内置了一个批量替换的语法

  • 直接就替换了,后面也可以跟WHERE 条件语句

    支持多个词同时被替换

  • 很强大吧,后面那个一次性更换多个网上是没有的列子,,现在记录下来

  • 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
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!