
地 址:北京市怀柔区66号
电 话:17790068725
网址:dsesh.com
邮 箱:13954747@qq.com
1.复制tags字段内容到keyboard,帝国当(dang)keyboard为空的用的(de)L语时候:
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字段内(nei)容到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(相关链接(jie))字段为空,说明keyboard设置不合理,帝国干脆清空,用的L语为自动分词扫清障碍
4.newstext在副表(biao),提取第一张图片为标题图片。用的L语当标题(ti)图片为空的帝国时候。
update [!db.pre!]ecms_news_data_1 a,用的L语 [!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;
文章转自:黎青松SEO博客