Home > Backend Development > PHP Tutorial > 关于mysql 批量替换的有关问题

关于mysql 批量替换的有关问题

WBOY
Release: 2016-06-13 13:33:44
Original
840 people have browsed it

关于mysql 批量替换的问题
表名是:sdb_daq_comment
字段是:content
content里面有一些 标记。
批量替换 mysql
标签的sql 怎么写?

------解决方案--------------------
update sdb_daq_comment set content=replace(content,'
','');
------解决方案--------------------

探讨

引用:

try~
SQL code

update sdb_daq_comment set content = REPLACE(content, '', '') where 1 = 1;


没有呢。是
但是 标签里面的内容是一个超链接 是一个不确定的值。怎么一起去掉

------解决方案--------------------
try again~
SQL code

update sdb_daq_comment set content = REPLACE(content , substring(content, locate('<a>',content), locate('</a>', content)), '') where 1=1; <div class="clear">
                 
              
              
        
            </div>
Copy after login
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