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.id=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;
标签: db, ecms, keyboard, news, pre
上面是“帝国cms常用的SQL语句”的全面内容,想了解更多关于 帝国cms 内容,请继续关注web建站教程。
当前网址:https://ipkd.cn/webs_845.html
workflows工作流
一座精致透明的白瓷人物雕塑comfyui工作流
一个表情深思熟虑的成熟男人
文生图工作流:树枝上站着一只鸟
1个粉红色头发可爱的女孩ComfyUI工作流
爱因斯坦在做实验3d动漫ComfyUI工作流
一张皮卡丘向观众眨眼的逼真照片ComfyUI工作流
一只猫捧着一条鱼ComfyUI工作流
一个迷人而丰满的女巫和一只黑猫骑着飞天扫帚
猜你喜欢
声明:本站提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请发送到邮箱:admin@ipkd.cn,我们会在看到邮件的第一时间内为您处理!