{"id":1076,"date":"2021-05-01T03:08:37","date_gmt":"2021-04-30T19:08:37","guid":{"rendered":"https:\/\/byy3.com\/?p=1076"},"modified":"2021-05-01T03:13:15","modified_gmt":"2021-04-30T19:13:15","slug":"wordpress%e5%88%a0%e9%99%a4%e9%87%8d%e5%a4%8d%e6%96%87%e7%ab%a0%e6%a0%87%e9%a2%98%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/byy3.com\/?p=1076","title":{"rendered":"wordpress\u5220\u9664\u91cd\u590d\u6587\u7ae0\u6807\u9898\u65b9\u6cd5!"},"content":{"rendered":"<p>\u7f51\u7ad9\u6700\u8fd1\u53d1\u73b0\u597d\u591a\u6587\u7ae0\u6709\u91cd\u590d\u7684\uff0c\u624b\u5de5\u4e00\u4e2a\u4e00\u4e2a\u5f88\u9ebb\u70e6\uff0c\u5c31\u60f3\u5230\u4e86\u7a0b\u5e8f\u3002\u4e0b\u9762\u5c31\u662fWordPress\u5220\u9664\u91cd\u590d\u6807\u9898\u6587\u7ae0\u7684\u51e0\u79cd\u65b9\u6cd5<\/p>\n<p>\u4e00\u3001\u901a\u8fc7\u64cd\u4f5cSQL\u6570\u636e\u5e93\u5220\u9664\uff1a<br \/>\n\u53bb\u9664\u91cd\u590d\u6587\u7ae0\uff0c\u53ea\u4fdd\u7559\u4e00\u7bc7<\/p>\n<p>CREATE TABLE my_tmp AS SELECT MIN(ID) AS col1 FROM wp_posts GROUP BY post_title;<\/p>\n<p>DELETE FROM wp_posts WHERE ID NOT IN (SELECT col1 FROM my_tmp);<\/p>\n<p>DROP TABLE my_tmp;<\/p>\n<p>\u53bb\u9664\u91cd\u590d\u6587\u7ae0\uff0c\u4e00\u7247\u90fd\u4e0d\u4fdd\u7559<\/p>\n<p>CREATE TABLE my_tmp AS Select ID AS col1 From wp_posts Where post_title In (Select post_title From wp_posts Group By post_title Having Count(*)&gt;2);<\/p>\n<p>DELETE FROM wp_posts WHERE ID IN (SELECT col1 FROM my_tmp);<\/p>\n<p>DROP TABLE my_tmp;<\/p>\n<p>\u53e6\u4e00\u79cd\u53bb\u9664\u6240\u6709\u91cd\u590d\u6587\u7ae0\u7684\u65b9\u6cd5<\/p>\n<p>CREATE TABLE my_tmp AS Select ID AS col1 From wp_posts Where post_title In (Select post_title From wp_posts Group By post_title Having Count(*)&gt;2);DELETE FROM wp_posts WHERE ID IN (SELECT col1 FROM my_tmp); DROP TABLE my_tmp;<\/p>\n<p>\u64cd\u4f5c\u65b9\u6cd5\u5f88\u7b80\u5355\uff0c\u53ea\u9700\u5c06\u4e0a\u9762\u7684SQL\u8bed\u53e5\uff0c\u653e\u5230\u81ea\u5df1\u7f51\u7ad9\u6570\u636e\u5e93\u7684 SQL\u6846\u91cc\uff0c\u7136\u540e\u6267\u884c\u5c31\u53ef\u4ee5\u4e86\u3002(\u6ce8\u610f\uff1a\u64cd\u4f5c\u4e4b\u524d\uff0c\u8bf7\u5148\u8fdb\u884c\u7f51\u7ad9\u5907\u4efd)<\/p>\n<p>\u4e8c\u3001php\u7a0b\u5e8f\u5220\u9664<br \/>\nrequire('.\/wp-load.php');<\/p>\n<p>$strsql=\"create table my_tmp as select min(ID) as col1 from cd_posts group by post_title\";<\/p>\n<p>$strsql1=\"delete from cd_posts where ID not in (select col1 from my_tmp)\";<\/p>\n<p>$strsql2=\"drop table my_tmp\";<\/p>\n<p>$result=mysql_query($strsql);<\/p>\n<p>$result=mysql_query($strsql1);<\/p>\n<p>$result=mysql_query($strsql2);<br \/>\n1<br \/>\n2<br \/>\n3<br \/>\n4<br \/>\n5<br \/>\n6<br \/>\n7<br \/>\n8<br \/>\n9<br \/>\n10<br \/>\n11<br \/>\n12<br \/>\n13<br \/>\n\u4fdd\u5b58\u4ee5\u4e0a\u4ee3\u7801\u4ee5\u4e3adelete.php\uff0c\u653e\u5728\u6839\u76ee\u5f55\uff0c\u60f3\u8981\u5220\u9664\u91cd\u590d\u6587\u7ae0\u7684\u65f6\u5019\uff0c\u8bbf\u95ee\u8fd9\u4e2a\u6587\u4ef6\u5c31\u53ef\u4ee5\u4e86\u3002<br \/>\n1<br \/>\n\u4e2a\u4eba\u5b9e\u6d4b\uff0c\u65b9\u6cd5\u4e00\u91cc\u9762\u7684\u7b2c1\u4e2a\u5b8c\u7f8e\u89e3\u51b3\u95ee\u9898\u3002<br \/>\n\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014<br \/>\n\u7248\u6743\u58f0\u660e\uff1a\u672c\u6587\u4e3aCSDN\u535a\u4e3b\u300csilence cc\u300d\u7684\u539f\u521b\u6587\u7ae0\uff0c\u9075\u5faaCC 4.0 BY-SA\u7248\u6743\u534f\u8bae\uff0c\u8f6c\u8f7d\u8bf7\u9644\u4e0a\u539f\u6587\u51fa\u5904\u94fe\u63a5\u53ca\u672c\u58f0\u660e\u3002<br \/>\n\u539f\u6587\u94fe\u63a5\uff1ahttps:\/\/blog.csdn.net\/qq_19339041\/article\/details\/115718437<\/p>\n<p>\u9009\u4e2d\u6570\u636e\u5e93\u4e2d\u7684\u8868\u683c\uff0c\u7136\u540e\u4e00\u53e5\u4e00\u53e5\u6267\u884c\uff01<\/p>\n<p><img decoding=\"async\" data-original=\"https:\/\/docs.microsoft.com\/fr-fr\/sql\/ssms\/f1-help\/media\/database-engine-query-editor-sql-server-management-studio\/new-query.png?view=sql-server-ver15\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" title=\"wordpress\u5220\u9664\u91cd\u590d\u6587\u7ae0\u6807\u9898\u65b9\u6cd5!\u63d2\u56fe\" alt=\"wordpress\u5220\u9664\u91cd\u590d\u6587\u7ae0\u6807\u9898\u65b9\u6cd5!\u63d2\u56fe\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7f51\u7ad9\u6700\u8fd1\u53d1\u73b0\u597d\u591a\u6587\u7ae0\u6709\u91cd\u590d\u7684\uff0c\u624b\u5de5\u4e00\u4e2a\u4e00\u4e2a\u5f88\u9ebb\u70e6\uff0c\u5c31\u60f3\u5230\u4e86\u7a0b\u5e8f\u3002\u4e0b\u9762\u5c31\u662fWordPress\u5220\u9664\u91cd\u590d\u6807\u9898\u6587\u7ae0\u7684\u51e0 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15],"tags":[16,648,649],"class_list":["post-1076","post","type-post","status-publish","format-standard","hentry","category-wordpress","tag-wordpress","tag-649"],"_links":{"self":[{"href":"https:\/\/byy3.com\/index.php?rest_route=\/wp\/v2\/posts\/1076","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/byy3.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/byy3.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/byy3.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/byy3.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1076"}],"version-history":[{"count":0,"href":"https:\/\/byy3.com\/index.php?rest_route=\/wp\/v2\/posts\/1076\/revisions"}],"wp:attachment":[{"href":"https:\/\/byy3.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1076"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/byy3.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1076"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/byy3.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1076"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}