如何用织梦SQL命令行工具操作数据库及常用sql语句整理(2)

delete from dede_addonarticle where aid >= 100 and aid< =5000; delete from dede_arctiny where id >= 100 and id< =5000; delete from dede_archives where id >= 100 and id<=5000;  

 

这段sql命令就是把文章id从100到5000的全部删除掉

 

织梦sql命令批量删除某个栏目下文章:
 

delete from dede_addonimages where typeid = 7; delete from dede_arctiny where typeid = 7; delete from dede_archives where typeid = 7;  

 

织梦sql命令批量删除指定栏目:
 

delete from dede_arctype where id in (93,94,95,96,97)  

 

注:这段sql命令就是把栏目id为93、94、95、96、97的栏目删除掉了

 

织梦sql命令批量合并文章到指定栏目:
 

update dede_archives set typeid='70' where typeid in (93,94,95,96,97)  

 

注:这段sql命令就是把栏目栏目id为93,94,95,96,97里面的文章归为栏目id为70的栏目下面

 

织梦sql命令批量合并栏目到指定栏目为子栏目:
 

Update `dede_arctype` set reid='目标父栏目ID' where id in(2,3,4,5)  

 

织梦sql命令批量清空文章:
 

delete from dede_addonarticle; delete from dede_addonimages; delete from dede_archives; delete from dede_arctiny; delete from dede_co_htmls; delete from dede_co_urls; delete from dede_co_mediaurls; delete from dede_tagindex ; delete from dede_taglist; delete from dede_keywords;  

 

注:这段sql命令意思是清空文章和原来采集过的记录

 

织梦新发布文章id从1开始:
 

alter table `dede_archives` auto_increment =1; alter table `dede_arctiny` auto_increment =1; alter table `dede_addonarticle` auto_increment =1;  

 

织梦新发布栏目id从1开始:
 

alter table `dede_arctype` auto_increment =1;  

 

注:表示新发布的文章或者栏目id从1开始,数字1也可以改为指定从任意id开始

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/2f17656639c284c33ad9fe401a7585b6.html