当前位置: > 数据库 > MySQL >

MySQL字符串查找替换更新_记录

时间:2014-12-11 01:03来源:linux.it.net.cn 作者:IT
use wordpressDB;
select post_title from wp_posts limit 1000;
select * from wp_posts where post_title="《树莓派LED呼吸灯》" ;
SELECT post_title FROM wp_posts WHERE post_title LIKE "《%";
 
 
select replace(replace(post_title, "《", ""),"》", "")
from wp_posts where post_title="《树莓派LED呼吸灯》" ;
 
SET SQL_SAFE_UPDATES=0;  //取消强制安全点限制
update wp_posts set post_title = replace(replace(post_title, "《", ""),"》", "")  where  post_title="《树莓派LED呼吸灯》"
 
update wp_posts set post_title = replace(replace(post_title, "《", ""),"》", "")  //所有
 
SET SQL_SAFE_UPDATES=1; //启用强制安全点限制

 
(责任编辑:IT)
------分隔线----------------------------
栏目列表
推荐内容