dedecms 数据库删除文章操作

删除文档小于500字符
delete dede_addonarticle,dede_archives FROM dede_addonarticle,dede_archives
where LENGTH(dede_addonarticle.body)<500 and dede_addonarticle.aid=dede_archives.id

新版:不知是否能用。
delete dede_addonarticle,dede_archives,,dede_arctiny FROM dede_addonarticle,dede_archives,dede_arctiny
where LENGTH(dede_addonarticle.body)<500 and dede_addonarticle.aid=dede_archives.id and dede_arctiny.id=dede_archives.id

查询表是否异常

select id from dede_arctiny where not exists(select * from dede_archives where dede_arctiny.id=dede_archives.id);

删除异常表
delete from dede_arctiny where id in ( select t.id from (select id from dede_arctiny where id not in (select id from dede_archives)) t)
删除文档标题包含域名的文档。

delete dede_addonarticle,dede_archives FROM dede_addonarticle,dede_archives
where dede_archives.title like “%域名%” and dede_addonarticle.aid=dede_archives.id