1、分表处理语句
/*首先插入5万到9万的数据到目标分表中*/
INSERT INTO phome_ecms_news_data_2 SELECT * FROM phome_ecms_news_data_1 T2 WHERE T2.ID> 50000 AND T2.ID< 90000;
/*然后删除原始分表中5万到9万的数据*/
delete from phome_ecms_news_data_1 WHERE ID> 50000 AND ID< 90000;
/*做完这些后,更新数据库缓存*/
2、图片前缀替换处理语句
/*替换略缩图前缀*/
UPDATE phome_ecms_news SET titlepic = replace(titlepic, 'https://www.2bp.net/upload/', '/upload/');
/*处理文章内容前缀*/
UPDATE phome_ecms_news_data_1 SET newstext = replace(newstext, '/upload/', '/upload/');
/*上面两段处理后运行下面两段*/
select id from phome_ecms_news where id not in (select id from phome_ecms_news_data_1)
update phome_ecms_news set stb =2 where id in (select id from phome_ecms_news_data_2)
3、按条件清空略缩图:
update phome_ecms_news set titlepic="" where titlepic like '%/upload/kook/%';
4、Tags处理:
UPDATE phome_enewstagsdata SET classid = replace(classid, '5', '39') where classid=5 ;
5、点击处理:
UPDATE phome_ecms_news SET onclick = replace(onclick, '0', '1');
