帝国cms中经常使用的SQL文
浏览:22 时间:2024-4-15

1.当键盘为空时,将标签字段内容复制到键盘:

更新[!db.pre!]ecms_news_data_1a,[!db.pre!]ecms _ newbsetb . keyboard=a . infotagswherea . id=b . idand b . keyboard=\' \';

2.将标签字段内容添加到键盘:

更新[!db.pre!]ecms_news_data_1a,[!db.pre!]ecms _ newbsetb . keyboard=concat(b . keyboard,\',\',a . info tags)what . id=b . idand b . keyboard \' \' anda . info tags \' \';

3.如果子表中的keyid(相关链接)字段为空,说明键盘设置不合理,干脆清空,为自动分词扫清障碍

更新[!db.pre!]ecms_news_data_1a,[!db.pre!]ecms _ newbsetb . keyboard=\' \' what . id=b . idanda . key id=\' \'

4.newstext在子表中,选择第一张图片作为标题图片。当标题图片为空时。

更新[!db.pre!]ecms_news_data_1a,[!db.pre!]ecms _ newbsetb . title pic=concat(replace(SUBSTRING _ INDEX(SUBSTRING _ INDEX)(a . news text,\')。jpg \',1),\' src=\',-1),\'\'\',\'\'),\'。jpg \')where . newtextlike“%”。jpg% \'和b.titlepic=\' \'和a . id=b . id;

更新[!db.pre!]ecms_news_data_1a,[!db.pre!]ecms _ newbsetb . title pic=concat(replace(SUBSTRING _ INDEX(SUBSTRING _ INDEX)(a . news text,\')。gif \'、1)、“src=”、-1)、“”、“”)、“”。gif \')where . newtextlike“%”。gif% \'和b.titlepic=\' \'和a . id=b . id;

文章转自:黎宋庆搜索引擎优化博客

来源地址:/CmSjiaocheng/diguojiaocheng/1685。超文本标记语言