• ADADADADAD

    帝国cms常用的SQL语句[ 网站建设 ]

    网站建设 时间:2024-12-03 10:14:07

    作者:文/会员上传

    简介:

    1.复制tags字段内容到keyboard,当keyboard为空的时候:update [!db.pre!]ecms_news_data_1 a, [!db.pre!]ecms_news b set b.keyboard=atags where a.id=b.id and b.keyboard='

    以下为本文的正文内容,内容仅供参考!本站为公益性网站,复制本文以及下载DOC文档全部免费。

    1.复制tags字段内容到keyboard,当keyboard为空的时候:

    update [!db.pre!]ecms_news_data_1 a, [!db.pre!]ecms_news b set b.keyboard=atags 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,',',atags) where a.id=b.id and b.keyboard<>'' and atags<>'';

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

    文章转自:黎青松SEO博客


    帝国cms常用的SQL语句.docx

    将本文的Word文档下载到电脑

    推荐度:

    下载
    热门标签: 帝国cms