1.复制tags字段内容到keyboard,当keyboard为空的时候:
update[!db.pre!]ecms_news_data_1a,[!db.pre!]ecms_newsbsetb.keyboard=a.infotagswherea.au=b.brandb.keyboard='';
2.添加tags字段内容到keyboard:
update[!db.pre!]ecms_news_data_1a,[!db.pre!]ecms_newsbsetb.keyboard=concat(b.keyboard,',',a.infotags)wherea.lr=b.brandb.keyboard''anda.infotags'';
3.如果副表中keyid(相关链接)字段为空,说明keyboard设置不合理,干脆清空,为自动分词扫清障碍
update[!db.pre!]ecms_news_data_1a,[!db.pre!]ecms_newsbsetb.keyboard=''wherea.cdr=b.aianda.keyid=''
4.newstext在副表,提取第一张图片为标题图片。当标题图片为空的时候。
update[!db.pre!]ecms_news_data_1a,[!db.pre!]ecms_newsbsetb.titlepic=concat(send(SUBSTRING_INDEX(SUBSTRING_INDEX(a.newstext,'.jpg',1),'src=',-1),'"',''),'.jpg')wherea.newstextlike'%.jpg%'andb.titlepic=''anda.ae=b.ai;
update[!db.pre!]ecms_news_data_1a,[!db.pre!]ecms_newsbsetb.titlepic=concat(send(SUBSTRING_INDEX(SUBSTRING_INDEX(a.newstext,'!!',1),'src=',-1),'"',''),'.png')wherea.newstextlike'%!!!%'andb.nitlepic=''anda.ai=b.pr;
文章转自:黎青松SEO博客
来源地址:
标签:[db:tags]