1.拷贝tags字段名內容到keyboard,当keyboard为空的情况下:
update [!db.pre!]ecms_news_data_1 a, [!db.pre!]ecms_news b set b.keyboard=a.infotags where a.id=b.id and b.keyboard='';
2.加上tags字段名內容到keyboard:
update [!db.pre!]ecms_news_data_1 a, [!db.pre!]ecms_news b set b.keyboard=concat(b.keyboard,',',a.infotags) where a.id=b.id and b.keyboard<>'' and a.infotags<>'';
3.假如副表中keyid(有关连接)字段名为空,表明keyboard设定不科学,果断清除,为全自动词性标注铲除阻碍
update [!db.pre!]ecms_news_data_1 a, [!db.pre!]ecms_news b set b.keyboard='' where a.i唐山市关键词排名d=b.id and a.keyid=''
4.newstext在副表,获取第一张照片为标题图片。当标题图片为空的情况下。
update [!db.pre!]ecms_news_data_1 a, [!db.pre!]ecms_news b set b.titlepic=concat(replace(SUBSTRING_INDEX(SUBSTRING_INDEX(a.newstext, '.jpg', 1),'src=',-1),'"',''),'.jpg') where a.newstext like '%.jpg%' and b.titlepic='' and a.id=b.id;
update [!db.pre!]ecms_news_data_1 a, [!db.pre!]ecms_news b set b.titlepic=concat(replace(SUBSTRING_INDEX(SUBSTRING_INDEX(a.newstext, '.gif', 1),'src=',-1),'"',''),'.gif') where a.newstext like '%.gif%' and b.titlepic='' and a.id=b.id;
文章内容转自:黎苍松SEOblog
来源于详细地址:http://www.alitaohuo.com/CMSjiaocheng/diguojiaocheng/1685.html