{"id":4319,"date":"2015-03-29T21:06:11","date_gmt":"2015-03-29T13:06:11","guid":{"rendered":"https:\/\/www.hmouse.tk\/?p=4319"},"modified":"2015-04-02T11:26:18","modified_gmt":"2015-04-02T03:26:18","slug":"phpwind-%e9%87%8d%e5%a4%8d%e5%b8%96%e5%ad%90%e5%88%a0%e9%99%a4%e5%8a%9e%e6%b3%95","status":"publish","type":"post","link":"https:\/\/www.hmouse.cn\/?p=4319","title":{"rendered":"phpwind \u91cd\u590d\u5e16\u5b50\u5220\u9664\u529e\u6cd5"},"content":{"rendered":"<p>\u67e5\u770b\u91cd\u590d\u5e16\u5b50  <\/p>\n<p>select subject from pw_bbs_threads group by subject&nbsp; having&nbsp; count(subject) &gt; 1;<\/p>\n<p>\u5220\u9664\u5e16\u5b50\uff0c\u4f46\u662f\u5b9e\u9645\u64cd\u4f5c\u7684\u65f6\u5019\uff0cmysql\u7248\u672c\u4e0d\u652f\u6301\u8fd9\u79cd\u5199\u6cd5\u3002<br \/>delete from pw_bbs_threads where subject&nbsp; in (select subject from pw_bbs_threads group by subject&nbsp; having&nbsp; count(subject) &gt; 1) and tid not in (select min(tid)&nbsp; from pw_bbs_threads group by subject&nbsp; having&nbsp; count(subject) &gt;1);<\/p>\n<p>\u67e5\u51fa\u91cd\u590d\u5e16\u5b50\u7684tid<br \/>select tid from pw_bbs_threads where subject&nbsp; in (select subject from pw_bbs_threads group by subject&nbsp; having&nbsp; count(subject) &gt; 1) and tid not in (select min(tid)&nbsp; from pw_bbs_threads group by subject&nbsp; having&nbsp; count(subject) &gt;1); <\/p>\n<p>\u5b9e\u9645\u5220\u9664\u91cd\u590d\u5e16\u5b50\u7684\u529e\u6cd5\uff1a<\/p>\n<p>create table tmp as select tid from pw_bbs_threads where subject&nbsp; in (select subject from pw_bbs_threads group by subject&nbsp; having&nbsp; count(subject) &gt; 1) and tid not in (select min(tid)&nbsp; from pw_bbs_threads group by subject&nbsp; having&nbsp; count(subject) &gt;1);  <\/p>\n<p>delete from pw_bbs_threads where tid&nbsp; in (select tid from tmp); <br \/>drop table tmp;  <\/p>\n<p>\u540e\u7eed\u7684\u8865\u5145\uff0c\u5176\u5b9e\u4e0a\u9762\u53ea\u662f\u5220\u9664\u4e86\u6807\u9898 \u8fd8\u9700\u8981\u5220\u9664\u5185\u5bb9<strong>pw_bbs_threads_content<\/strong>\u8868\u7684\u6570\u636e  <\/p>\n<p>create table tmp as select tid from pw_bbs_threads ;  <\/p>\n<p>delete from pw_bbs_threads_content where tid not in (select tid from tmp); <br \/>drop table tmp; <\/p>\n<p>\u4e0a\u9762\u7684\u5176\u5b9e\u53ef\u4ee5\u6267\u884c\u6210<\/p>\n<p>create table tmp as select tid from pw_bbs_threads where subject in (select subject from pw_bbs_threads group by subject having count(subject) &gt; 1) and tid not in (select min(tid) from pw_bbs_threads group by subject having count(subject) &gt;1);  <\/p>\n<p>delete from pw_bbs_threads where tid in (select tid from tmp); <\/p>\n<p>delete from pw_bbs_threads_content where tid in (select tid from tmp);  <\/p>\n<p>drop table tmp; <\/p>\n<p>&nbsp;<\/p>\n<p>\u53c2\u8003\u662f\uff1a<a title=\"http:\/\/blog.csdn.net\/softwave\/article\/details\/3890576\" href=\"http:\/\/blog.csdn.net\/softwave\/article\/details\/3890576\">http:\/\/blog.csdn.net\/softwave\/article\/details\/3890576<\/a>  <\/p>\n<p><strong>MySQL\u67e5\u8be2\u53ca\u5220\u9664\u91cd\u590d\u8bb0\u5f55\u7684\u65b9\u6cd5<\/strong>  <\/p>\n<p>(\u4e00)<br \/>1\u3001\u67e5\u627e\u8868\u4e2d\u591a\u4f59\u7684\u91cd\u590d\u8bb0\u5f55\uff0c\u91cd\u590d\u8bb0\u5f55\u662f\u6839\u636e\u5355\u4e2a\u5b57\u6bb5\uff08peopleId\uff09\u6765\u5224\u65ad<br \/>select * from people<br \/>where peopleId in (select&nbsp; peopleId&nbsp; from&nbsp; people&nbsp; group&nbsp; by&nbsp; peopleId&nbsp; having&nbsp; count(peopleId) &gt; 1)<br \/>2\u3001\u5220\u9664\u8868\u4e2d\u591a\u4f59\u7684\u91cd\u590d\u8bb0\u5f55\uff0c\u91cd\u590d\u8bb0\u5f55\u662f\u6839\u636e\u5355\u4e2a\u5b57\u6bb5\uff08peopleId\uff09\u6765\u5224\u65ad\uff0c\u53ea\u7559\u6709rowid\u6700\u5c0f\u7684\u8bb0\u5f55<br \/>delete from people<br \/>where peopleId&nbsp; in (select&nbsp; peopleId&nbsp; from people&nbsp; group&nbsp; by&nbsp; peopleId&nbsp;&nbsp; having&nbsp; count(peopleId) &gt; 1)<br \/>and rowid not in (select min(rowid) from&nbsp; people&nbsp; group by peopleId&nbsp; having count(peopleId )&gt;1)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u67e5\u770b\u91cd\u590d\u5e16\u5b50  <\/p>\n<p>select subject from pw_bbs_threads group by subject&nbsp; having&nbsp; count(subject) &gt; 1;<\/p>\n<p>\u5220\u9664\u5e16\u5b50\uff0c\u4f46\u662f\u5b9e\u9645\u64cd\u4f5c\u7684\u65f6\u5019\uff0cmysql\u7248\u672c\u4e0d\u652f\u6301\u8fd9\u79cd\u5199\u6cd5\u3002<br \/>delete from pw_bbs_threads where subject&nbsp; in (select subject from pw_bbs_threads group by subject&nbsp; having&nbsp; count(subject) &gt; 1) and tid not in (select min(tid)&nbsp; from pw_bbs_threads group by subject&nbsp; having&nbsp; count(subject) &gt;1);<\/p>\n<p>\u67e5\u51fa\u91cd\u590d\u5e16\u5b50\u7684tid<br \/>select tid from pw_bbs_threads where subject&nbsp; in (select subject from pw_bbs_threads group by subject&nbsp; having&nbsp; count(subject) &gt; 1) and tid not in (select min(tid)&nbsp; from pw_bbs_threads group by subject&nbsp; having&nbsp; count(subject) &gt;1); <\/p>\n<p>\u5b9e\u9645\u5220\u9664\u91cd\u590d\u5e16\u5b50\u7684\u529e\u6cd5\uff1a<\/p>\n<p>create table tmp as select tid from pw_bbs_threads where subject&nbsp; in (select subject from pw_bbs_threads group by subject&nbsp; having&nbsp; count(subject) &gt; 1) and tid not in (select min(tid)&nbsp; from pw_bbs_threads group by subject&nbsp; having&nbsp; count(subject) &gt;1);  <\/p>\n<p>delete from pw_bbs_threads where tid&nbsp; in (select tid from tmp); <br \/>drop table tmp;  <\/p>\n<p>\u540e\u7eed\u7684\u8865\u5145\uff0c\u5176\u5b9e\u4e0a\u9762\u53ea\u662f\u5220\u9664\u4e86\u6807\u9898 \u8fd8\u9700\u8981\u5220\u9664\u5185\u5bb9<strong>pw_bbs_threads_content<\/strong>\u8868\u7684\u6570\u636e  <\/p>\n<p>create table tmp as select tid from pw_bbs_threads ;  <\/p>\n<p>delete from pw_bbs_threads_content where tid not in (select tid from tmp); <br \/>drop table tmp; <\/p>\n<p>\u4e0a\u9762\u7684\u5176\u5b9e\u53ef\u4ee5\u6267\u884c\u6210<\/p>\n<p>create table tmp as select tid from pw_bbs_threads where subject in (select subject from pw_bbs_threads group by subject having count(subject) &gt; 1) and tid not in (select min(tid) from pw_bbs_threads group by subject having count(subject) &gt;1);  <\/p>\n<p>delete from pw_bbs_threads where tid in (select tid from tmp); <\/p>\n<p>delete from pw_bbs_threads_content where tid in (select tid from tmp);  <\/p>\n<p>drop table tmp; <\/p>\n<p>&nbsp;<\/p>\n<p>\u53c2\u8003\u662f\uff1a<a title=\"http:\/\/blog.csdn.net\/softwave\/article\/details\/3890576\" href=\"http:\/\/blog.csdn.net\/softwave\/article\/details\/3890576\">http:\/\/blog.csdn.net\/softwave\/article\/details\/3890576<\/a>  <\/p>\n<p><strong>MySQL\u67e5\u8be2\u53ca\u5220\u9664\u91cd\u590d\u8bb0\u5f55\u7684\u65b9\u6cd5<\/strong>  <\/p>\n<p>(\u4e00)<br \/>1\u3001\u67e5\u627e\u8868\u4e2d\u591a\u4f59\u7684\u91cd\u590d\u8bb0\u5f55\uff0c\u91cd\u590d\u8bb0\u5f55\u662f\u6839\u636e\u5355\u4e2a\u5b57\u6bb5\uff08peopleId\uff09\u6765\u5224\u65ad<br \/>select * from people<br \/>where peopleId in (select&nbsp; peopleId&nbsp; from&nbsp; people&nbsp; group&nbsp; by&nbsp; peopleId&nbsp; having&nbsp; count(peopleId) &gt; 1)<br \/>2\u3001\u5220\u9664\u8868\u4e2d\u591a\u4f59\u7684\u91cd\u590d\u8bb0\u5f55\uff0c\u91cd\u590d\u8bb0\u5f55\u662f\u6839\u636e\u5355\u4e2a\u5b57\u6bb5\uff08peopleId\uff09\u6765\u5224\u65ad\uff0c\u53ea\u7559\u6709rowid\u6700\u5c0f\u7684\u8bb0\u5f55<br \/>delete from people<br \/>where peopleId&nbsp; in (select&nbsp; peopleId&nbsp; from people&nbsp; group&nbsp; by&nbsp; peopleId&nbsp;&nbsp; having&nbsp; count(peopleId) &gt; 1)<br \/>and rowid not in (select min(rowid) from&nbsp; people&nbsp; group by peopleId&nbsp; having count(peopleId )&gt;1)<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[83,84],"class_list":["post-4319","post","type-post","status-publish","format-standard","hentry","category-5","tag-phpwind","tag-84","category-5-id","post-seq-1","post-parity-odd","meta-position-corners","fix"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.hmouse.cn\/index.php?rest_route=\/wp\/v2\/posts\/4319","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hmouse.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hmouse.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hmouse.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hmouse.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4319"}],"version-history":[{"count":4,"href":"https:\/\/www.hmouse.cn\/index.php?rest_route=\/wp\/v2\/posts\/4319\/revisions"}],"predecessor-version":[{"id":4324,"href":"https:\/\/www.hmouse.cn\/index.php?rest_route=\/wp\/v2\/posts\/4319\/revisions\/4324"}],"wp:attachment":[{"href":"https:\/\/www.hmouse.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4319"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hmouse.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4319"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hmouse.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4319"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}