帝国cms常用的SQL语句

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,'.gif','.gif')  where  a.newstext  like  '%.gif%'  and  b.titlepic='' and a.id=b.id;

总结

以上收集整理的帝国cms常用的SQL语句全部内容,希望文章能够帮你解决帝国cms常用的SQL语句所遇到的程序开发问题。

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,'.gif','.gif')  where  a.newstext  like  '%.gif%'  and  b.titlepic='' and a.id=b.id;

总结

以上是为你收集整理的帝国cms常用的SQL语句全部内容,希望文章能够帮你解决帝国cms常用的SQL语句所遇到的程序开发问题。

未经允许不得转载:OZ分享-吉家大宝官方博客 » 帝国cms常用的SQL语句

评论 0

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

置顶文章