{"id":25379,"date":"2024-11-24T10:01:33","date_gmt":"2024-11-24T02:01:33","guid":{"rendered":"https:\/\/fwq.ai\/blog\/25379\/"},"modified":"2024-11-24T10:01:33","modified_gmt":"2024-11-24T02:01:33","slug":"%e5%a6%82%e4%bd%95%e4%bd%bf%e7%94%a8-mysql-%e6%9f%a5%e8%af%a2%e9%87%8d%e5%a4%8d%e7%9a%84-refund_id-%e8%ae%b0%e5%bd%95%e5%8f%8a%e5%85%b6%e5%85%b3%e8%81%94%e7%9a%84-return_code-%e4%b8%ba-success-2","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/25379\/","title":{"rendered":"\u5982\u4f55\u4f7f\u7528 MySQL \u67e5\u8be2\u91cd\u590d\u7684 refund_id \u8bb0\u5f55\u53ca\u5176\u5173\u8054\u7684 return_code \u4e3a &#8216;SUCCESS&#8217; \u7684\u8bb0\u5f55\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173060353910272.jpg\" class=\"aligncenter\" title=\"\u5982\u4f55\u4f7f\u7528 MySQL \u67e5\u8be2\u91cd\u590d\u7684 refund_id \u8bb0\u5f55\u53ca\u5176\u5173\u8054\u7684 return_code \u4e3a &#8216;SUCCESS&#8217; \u7684\u8bb0\u5f55\uff1f\u63d2\u56fe\" alt=\"\u5982\u4f55\u4f7f\u7528 MySQL \u67e5\u8be2\u91cd\u590d\u7684 refund_id \u8bb0\u5f55\u53ca\u5176\u5173\u8054\u7684 return_code \u4e3a &#8216;SUCCESS&#8217; \u7684\u8bb0\u5f55\uff1f\u63d2\u56fe\" \/><\/p>\n<p>\u67e5\u8be2\u91cd\u590d\u8bb0\u5f55\u53ca\u5176\u5173\u8054\u8bb0\u5f55<\/p>\n<p><strong>\u95ee\u9898<\/strong><\/p>\n<p>\u5982\u4f55\u5728  \u4e2d\u67e5\u8be2\u5305\u542b\u4ee5\u4e0b\u6761\u4ef6\u7684\u8bb0\u5f55\uff1a<\/p>\n<ul>\n<li>\u5b57\u6bb5 refund_id \u6709\u76f8\u540c\u7684\u7279\u5b9a\u503c<\/li>\n<li>\u53e6\u4e00\u4e2a\u5b57\u6bb5 return_code \u7684\u503c\u4e3a &#8216;success&#8217;<\/li>\n<li>\u6ee1\u8db3\u4e0a\u8ff0\u6761\u4ef6\u7684\u8bb0\u5f55\u6570\u91cf\u5927\u4e8e\u6216\u7b49\u4e8e 2<\/li>\n<\/ul>\n<p><strong>\u56de\u7b54<\/strong><\/p>\n<p>\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u67e5\u8be2\u6765\u67e5\u627e\u6ee1\u8db3\u8fd9\u4e9b\u6761\u4ef6\u7684\u8bb0\u5f55\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><strong>\u89e3\u91ca<\/strong><\/p>\n<p>\u8fd9\u4e2a\u67e5\u8be2\u4f7f\u7528\u5b50\u67e5\u8be2\u6765\u6807\u8bc6 refund_id \u76f8\u540c\u5e76\u4e14 return_code \u7b49\u4e8e &#8216;success&#8217; \u7684\u8bb0\u5f55\u6570\u91cf\u5927\u4e8e\u6216\u7b49\u4e8e 2\u3002\u8be5\u5b50\u67e5\u8be2\u4f7f\u7528 group by \u548c having \u5b50\u53e5\u6765\u5bf9 refund_id \u8fdb\u884c\u5206\u7ec4\u5e76\u6839\u636e\u8bb0\u5f55\u6570\u91cf\u8fc7\u6ee4\u7ed3\u679c\u3002<\/p>\n<p>\u7136\u540e\uff0c\u4e3b\u67e5\u8be2\u4f7f\u7528 in \u5b50\u53e5\u4ece refund_id \u5339\u914d\u5b50\u67e5\u8be2\u7ed3\u679c\u7684\u4e3b\u8868\u4e2d\u9009\u62e9\u8bb0\u5f55\u3002\u8fd9\u5c06\u8fd4\u56de\u6240\u6709\u5305\u542b refund_id\uff08\u5373\u91cd\u590d\u8bb0\u5f55\u7684 refund_id\uff09\u7684\u8bb0\u5f55\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u4f7f\u7528 MySQL \u67e5\u8be2\u91cd\u590d\u7684 refund_id \u8bb0\u5f55\u53ca\u5176\u5173\u8054\u7684 return_code \u4e3a &#8216;SUCCESS&#8217; \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\u91cd\u590d\u8bb0\u5f55\u53ca\u5176\u5173\u8054\u8bb0\u5f55 \u95ee\u9898 \u5982\u4f55\u5728 \u4e2d\u67e5\u8be2\u5305\u542b\u4ee5\u4e0b\u6761\u4ef6\u7684\u8bb0\u5f55\uff1a \u5b57\u6bb5 refund_id \u6709\u76f8\u540c\u7684\u7279\u5b9a\u503c \u53e6\u4e00\u4e2a\u5b57\u6bb5 return_code \u7684\u503c\u4e3a &#8216;success&#8217; \u6ee1\u8db3\u4e0a\u8ff0\u6761\u4ef6\u7684\u8bb0\u5f55\u6570\u91cf\u5927\u4e8e\u6216\u7b49\u4e8e 2 \u56de\u7b54 \u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u67e5\u8be2\u6765\u67e5\u627e\u6ee1\u8db3\u8fd9\u4e9b\u6761\u4ef6\u7684\u8bb0\u5f55\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 \u89e3\u91ca \u8fd9\u4e2a\u67e5\u8be2\u4f7f\u7528\u5b50\u67e5\u8be2\u6765\u6807\u8bc6 refund_id \u76f8\u540c\u5e76\u4e14 return_code \u7b49\u4e8e &#8216;success&#8217; \u7684\u8bb0\u5f55\u6570\u91cf\u5927\u4e8e\u6216\u7b49\u4e8e 2\u3002\u8be5\u5b50\u67e5\u8be2\u4f7f\u7528 group by \u548c having \u5b50\u53e5\u6765\u5bf9 refund_id [&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-25379","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/25379","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=25379"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/25379\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=25379"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=25379"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=25379"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}