分两段代码分别执行,第一段是删除多余重复标题,第二段是跟随内容删除多余的TAG标签,两个SQL命令需要分别执行。
DELETEFROMle_cms_articleWHEREtitle IN ( SELECT a.title FROM ( SELECT title FROM le_cms_article GROUP BY title HAVING count( title ) > 1 ) a )AND id NOT IN (SELECTb.idFROM( SELECT id FROM le_cms_article GROUP BY title HAVING count( title ) > 1 ) b)
delete from le_cms_article_data where not exists (select * from le_cms_article where le_cms_article_data.id =le_cms_article.id);
希望以上内容对你有所帮助!如果还有其他问题,请随时提问。 各类知识收集 拥有多年CMS企业建站经验,对 iCMS, Fastadmin, ClassCMS, LeCMS, PbootCMS, PHPCMS, 易优CMS, YzmCMS, 讯睿CMS, 极致CMS, Wordpress, HkCMS, YznCMS, WellCMS, ThinkCMF, 等各类cms的相互转化,程序开发,网站制作,bug修复,程序杀毒,插件定制都可以提供最佳解决方案。