{"id":25399,"date":"2024-11-24T09:06:49","date_gmt":"2024-11-24T01:06:49","guid":{"rendered":"https:\/\/fwq.ai\/blog\/25399\/"},"modified":"2024-11-24T09:06:49","modified_gmt":"2024-11-24T01:06:49","slug":"%e5%a6%82%e4%bd%95%e6%9f%a5%e8%af%a2-mysql-%e4%b8%ad-refund_id-%e7%9b%b8%e5%90%8c%e4%b8%94-return_code-%e4%b8%ba-success-%e7%9a%84%e8%ae%b0%e5%bd%95%ef%bc%8c%e5%b9%b6%e7%ad%9b%e9%80%89%e5%87%ba-retu-2","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/25399\/","title":{"rendered":"\u5982\u4f55\u67e5\u8be2 MySQL \u4e2d refund_id \u76f8\u540c\u4e14 return_code \u4e3a SUCCESS \u7684\u8bb0\u5f55\uff0c\u5e76\u7b5b\u9009\u51fa return_code=SUCCESS \u51fa\u73b0\u6b21\u6570\u5927\u4e8e\u6216\u7b49\u4e8e 2 \u7684\u8bb0\u5f55\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173060712433098.jpg\" class=\"aligncenter\" title=\"\u5982\u4f55\u67e5\u8be2 MySQL \u4e2d refund_id \u76f8\u540c\u4e14 return_code \u4e3a SUCCESS \u7684\u8bb0\u5f55\uff0c\u5e76\u7b5b\u9009\u51fa return_code=SUCCESS \u51fa\u73b0\u6b21\u6570\u5927\u4e8e\u6216\u7b49\u4e8e 2 \u7684\u8bb0\u5f55\uff1f\u63d2\u56fe\" alt=\"\u5982\u4f55\u67e5\u8be2 MySQL \u4e2d refund_id \u76f8\u540c\u4e14 return_code \u4e3a SUCCESS \u7684\u8bb0\u5f55\uff0c\u5e76\u7b5b\u9009\u51fa return_code=SUCCESS \u51fa\u73b0\u6b21\u6570\u5927\u4e8e\u6216\u7b49\u4e8e 2 \u7684\u8bb0\u5f55\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong> \u67e5\u8be2\u4e24\u4e2a\u5b57\u6bb5\u7279\u5b9a\u503c\u4e14\u91cd\u590d\u8bb0\u5f55<\/strong><\/p>\n<p>\u5982\u4f55\u67e5\u8be2 <strong>refund_id<\/strong> \u76f8\u540c\uff0c\u4e14 <strong>return_code<\/strong> \u4e3a <strong>success<\/strong> \u7684\u8bb0\u5f55\uff0c\u5e76\u4e14\u8be5\u8bb0\u5f55\u4e2d\u7684 <strong>return_code=success<\/strong> \u51fa\u73b0\u5927\u4e8e\u6216\u7b49\u4e8e 2 \u6761\u91cd\u590d\u8bb0\u5f55\uff1f<\/p>\n<p><strong>\u89e3\u51b3\u65b9\u6848\uff1a<\/strong><\/p>\n<p>\u4f7f\u7528\u4ee5\u4e0b sql \u67e5\u8be2\uff1a<\/p>\n<pre>select * from \u8868 where refund_id in (\n    select refund_id from \u8868\n    where return_code = 'SUCCESS'\n    group by refund_id\n    having count(*) &gt;= 2\n);<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u6b64\u67e5\u8be2\u901a\u8fc7\u4ee5\u4e0b\u6b65\u9aa4\u5b9e\u73b0\uff1a<\/p>\n<ol>\n<li>\u5185\u90e8\u67e5\u8be2 select refund_id from \u8868&#8230; \u627e\u5230\u6240\u6709 <strong>return_code<\/strong> \u4e3a <strong>success<\/strong> \u7684 <strong>refund_id<\/strong>\uff0c\u5e76\u6309 <strong>refund_id<\/strong> \u5206\u7ec4\u3002<\/li>\n<li>having count(*) &gt;= 2 \u5b50\u53e5\u8fc7\u6ee4\u51fa\u51fa\u73b0\u6b21\u6570\u5927\u4e8e\u6216\u7b49\u4e8e 2 \u7684 <strong>refund_id<\/strong> \u7ec4\u3002<\/li>\n<li>\u5916\u90e8\u67e5\u8be2 select * from \u8868&#8230; \u4f7f\u7528 in \u64cd\u4f5c\u7b26\u5c06\u5185\u90e8\u67e5\u8be2\u7684\u5b50\u7ed3\u679c\u4f5c\u4e3a <strong>refund_id<\/strong> \u7684\u7b5b\u9009\u6761\u4ef6\uff0c\u8fd4\u56de\u7b26\u5408\u6761\u4ef6\u7684\u8bb0\u5f55\u3002<\/li>\n<\/ol>\n<p>\u56e0\u6b64\uff0c\u6267\u884c\u6b64\u67e5\u8be2\u5c06\u8fd4\u56de <strong>refund_id<\/strong> \u76f8\u540c\uff0c\u4e14 <strong>return_code=success<\/strong> \u7684\u8bb0\u5f55\uff0c\u5e76\u4e14\u8be5\u8bb0\u5f55\u4e2d\u7684 <strong>return_code=success<\/strong> \u51fa\u73b0\u81f3\u5c11 2 \u6761\u91cd\u590d\u8bb0\u5f55\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u67e5\u8be2 MySQL \u4e2d refund_id \u76f8\u540c\u4e14 return_code \u4e3a SUCCESS \u7684\u8bb0\u5f55\uff0c\u5e76\u7b5b\u9009\u51fa return_code=SUCCESS \u51fa\u73b0\u6b21\u6570\u5927\u4e8e\u6216\u7b49\u4e8e 2 \u7684\u8bb0\u5f55\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u67e5\u8be2\u4e24\u4e2a\u5b57\u6bb5\u7279\u5b9a\u503c\u4e14\u91cd\u590d\u8bb0\u5f55 \u5982\u4f55\u67e5\u8be2 refund_id \u76f8\u540c\uff0c\u4e14 return_code \u4e3a success \u7684\u8bb0\u5f55\uff0c\u5e76\u4e14\u8be5\u8bb0\u5f55\u4e2d\u7684 return_code=success \u51fa\u73b0\u5927\u4e8e\u6216\u7b49\u4e8e 2 \u6761\u91cd\u590d\u8bb0\u5f55\uff1f \u89e3\u51b3\u65b9\u6848\uff1a \u4f7f\u7528\u4ee5\u4e0b sql \u67e5\u8be2\uff1a select * from \u8868 where refund_id in ( select refund_id from \u8868 where return_code = &#8216;SUCCESS&#8217; group by refund_id having count(*) &gt;= 2 ); \u767b\u5f55\u540e\u590d\u5236 \u6b64\u67e5\u8be2\u901a\u8fc7\u4ee5\u4e0b\u6b65\u9aa4\u5b9e\u73b0\uff1a \u5185\u90e8\u67e5\u8be2 select refund_id from \u8868&#8230; \u627e\u5230\u6240\u6709 return_code \u4e3a success \u7684 refund_id\uff0c\u5e76\u6309 refund_id \u5206\u7ec4\u3002 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-25399","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/25399","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=25399"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/25399\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=25399"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=25399"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=25399"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}