1.復(fù)制tags字段內(nèi)容到keyboard,當(dāng)keyboard為空的時(shí)候:
copyright limeiseo
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=''; copyright limeiseo
2.添加tags字段內(nèi)容到keyboard:
利美項(xiàng)目圈
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'';
copyright limeiseo
3.如果副表中keyid(相關(guān)鏈接)字段為空,說(shuō)明keyboard設(shè)置不合理,干脆清空,為自動(dòng)分詞掃清障礙
update [!db.pre!]ecms_news_data_1 a, [!db.pre!]ecms_news b set b.keyboard='' where a.id=b.id and a.keyid=''
本文利美網(wǎng)絡(luò)(www.nippyllc.com)整理發(fā)布
4.newstext在副表,提取第一張圖片為標(biāo)題圖片。當(dāng)標(biāo)題圖片為空的時(shí)候。
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; 利美知識(shí)百科
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; limeiseo(加v分享)
本文標(biāo)簽: