當(dāng)前位置:首頁 >  站長 >  建站經(jīng)驗(yàn) >  正文

帝國cms常用的SQL語句

 2020-11-02 15:57  來源: 黎青松SEO博客   我來投稿 撤稿糾錯

  域名預(yù)訂/競價(jià),好“米”不錯過

1.復(fù)制tags字段內(nèi)容到keyboard,當(dāng)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字段內(nèi)容到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(相關(guān)鏈接)字段為空,說明keyboard設(shè)置不合理,干脆清空,為自動分詞掃清障礙

update [!db.pre!]ecms_news_data_1 a, [!db.pre!]ecms_news b set b.keyboard='' where a.id=b.id and a.keyid=''

4.newstext在副表,提取第一張圖片為標(biāo)題圖片。當(dāng)標(biāo)題圖片為空的時候。

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;

文章轉(zhuǎn)自:黎青松SEO博客

來源地址:http://www.alitaohuo.com/CMSjiaocheng/diguojiaocheng/1685.html

申請創(chuàng)業(yè)報(bào)道,分享創(chuàng)業(yè)好點(diǎn)子。點(diǎn)擊此處,共同探討創(chuàng)業(yè)新機(jī)遇!

相關(guān)標(biāo)簽
帝國cms

相關(guān)文章

熱門排行

信息推薦