mysql语句,该如何处理

WBOY
Release: 2016-06-13 13:46:37
Original
985 people have browsed it

mysql语句
请问一条mysql 删除语句, 把包含网址的都删除...例如 一篇文章里面包含了又网址链接 我要把所有有这个网址都删除,, http://www.baidu.com 或者 www.baidu.com 都给删除 这删除语句在怎么写

------解决方案--------------------
update table set fieldName = fieldName.str_replace ...
------解决方案--------------------
将有网址的记录删除
delete from 表名 where 字段名 link '%www.baidu.com%'

将内容里的网址去掉
update 表名 set 字段名= 字段名.str_replace('www.baidu.com','')
------解决方案--------------------
把http://www.baidu.com替换掉就ok了。
注意顺序:

SQL code

update 表名 set 字段名= 字段名.str_replace(http://www.baidu.com','')
update 表名 set 字段名= 字段名.str_replace(www.baidu.com','')
<br><font color="#e78608">------解决方案--------------------</font><br>
Copy after login
SQL code
update 表名 set 字段名= 字段名.str_replace('http://www.baidu.com','')
update 表名 set 字段名= 字段名.str_replace('www.baidu.com','')
<br><font color="#e78608">------解决方案--------------------</font><br>学习过了。谢谢。…… <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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!