{"id":200227,"date":"2025-05-06T11:41:20","date_gmt":"2025-05-06T03:41:20","guid":{"rendered":"https:\/\/server.hk\/cnblog\/200227\/"},"modified":"2025-05-06T11:41:20","modified_gmt":"2025-05-06T03:41:20","slug":"%e5%a6%82%e4%bd%95%e5%b0%86%e5%a4%9a%e6%9d%a1%e6%97%a5%e6%9c%9f%e5%8c%ba%e9%97%b4%e7%bb%9f%e8%ae%a1%e6%9f%a5%e8%af%a2%e5%90%88%e5%b9%b6%e4%b8%ba%e5%8d%95%e6%9d%a1%e6%9f%a5%e8%af%a2%ef%bc%8c%e6%8f%90","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/200227\/","title":{"rendered":"\u5982\u4f55\u5c06\u591a\u6761\u65e5\u671f\u533a\u95f4\u7edf\u8ba1\u67e5\u8be2\u5408\u5e76\u4e3a\u5355\u6761\u67e5\u8be2\uff0c\u63d0\u9ad8\u6548\u7387\u5e76\u7b80\u5316\u4ee3\u7801\uff1f"},"content":{"rendered":"<p><b><\/b> <\/p>\n<h1>\u5982\u4f55\u5c06\u591a\u6761\u65e5\u671f\u533a\u95f4\u7edf\u8ba1\u67e5\u8be2\u5408\u5e76\u4e3a\u5355\u6761\u67e5\u8be2\uff0c\u63d0\u9ad8\u6548\u7387\u5e76\u7b80\u5316\u4ee3\u7801\uff1f<\/h1>\n<p>\u4eca\u5929\u4e3b\u673a\u5b9d\u8d1d\u7ed9\u5927\u5bb6\u5e26\u6765\u4e86\uff0c\u5176\u4e2d\u6d89\u53ca\u5230\u7684\u77e5\u8bc6\u70b9\u5305\u62ec\u7b49\u7b49\uff0c\u65e0\u8bba\u4f60\u662f\u5c0f\u767d\u8fd8\u662f\u8001\u624b\uff0c\u90fd\u9002\u5408\u770b\u4e00\u770b\u54e6~\u6709\u597d\u7684\u5efa\u8bae\u4e5f\u6b22\u8fce\u5927\u5bb6\u5728\u8bc4\u8bba\u7559\u8a00\uff0c\u82e5\u662f\u770b\u5b8c\u6709\u6240\u6536\u83b7\uff0c\u4e5f\u5e0c\u671b\u5927\u5bb6\u80fd\u591a\u591a\u70b9\u8d5e\u652f\u6301\u5440\uff01\u4e00\u8d77\u52a0\u6cb9\u5b66\u4e60~<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241029\/1730176966672067c66113f.jpg\" class=\"aligncenter\"><\/p>\n<p><strong>\u5408\u5e76\u591a\u6761\u67e5\u8be2\u4e3a\u5355\u6761\u67e5\u8be2<\/strong><\/p>\n<p>\u5728\u5904\u7406\u6570\u636e\u65f6\uff0c\u6211\u4eec\u7ecf\u5e38\u9700\u8981\u901a\u8fc7\u591a\u4e2a\u67e5\u8be2\u6765\u83b7\u53d6\u6240\u9700\u4fe1\u606f\u3002\u7136\u800c\uff0c\u5c06\u8fd9\u4e9b\u67e5\u8be2\u5408\u5e76\u4e3a\u5355\u6761\u67e5\u8be2\u53ef\u4ee5\u63d0\u9ad8\u6548\u7387\u5e76\u7b80\u5316\u4ee3\u7801\u3002<\/p>\n<p><strong>\u5408\u5e76\u4e09\u6761\u65e5\u671f\u533a\u95f4\u7edf\u8ba1\u67e5\u8be2<\/strong><\/p>\n<p>\u4ee5\u4e0b\u4e09\u6761\u67e5\u8be2\u5206\u522b\u7edf\u8ba1\u7ed9\u5b9a\u65e5\u671f\u8303\u56f4\u5185\u4e0d\u540c\u7684\u65e5\u671f\u7c92\u5ea6\u4e0b\u7684\u6570\u636e\u6570\u91cf\uff1a<\/p>\n<pre>select count(1) as flownum from ccform_debit_all where cf_acctime &gt; to_char(sysdate, 'yyyy-mm-dd');\nselect count(1) as flownummonth from ccform_debit_all where cf_acctime &gt; to_char(sysdate, 'yyyy-mm');\nselect count(1) as flownumtotal from ccform_debit_all where cf_acctime &gt; to_char(sysdate, 'yyyy');<\/pre>\n<p>\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u4f7f\u7528 case \u8868\u8fbe\u5f0f\u5c06\u8fd9\u4e09\u6761\u67e5\u8be2\u5408\u5e76\u4e3a\u5355\u6761\u67e5\u8be2\u3002case \u8868\u8fbe\u5f0f\u6839\u636e cf_acctime \u5217\u4e0e\u4e0d\u540c\u65e5\u671f\u7c92\u5ea6\u7684\u6bd4\u8f83\u7ed3\u679c\uff0c\u751f\u6210\u76f8\u5e94\u7684\u7edf\u8ba1\u503c\uff1a<\/p>\n<pre>select count(case when to_char(cf_acctime, 'yyyy-MM-dd') &gt; to_char(sysdate, 'yyyy-MM-dd') then 1 end) as flowNum,\n       count(case when to_char(cf_acctime, 'yyyy-MM') &gt; to_char(sysdate, 'yyyy-MM') then 1 end)       as flowNumMonth,\n       count(case when to_char(cf_acctime, 'yyyy') &gt; to_char(sysdate, 'yyyy') then 1 end)             as flowNumTotal\nfrom ccform_debit_all<\/pre>\n<p>\u6267\u884c\u6b64\u67e5\u8be2\u5c06\u8fd4\u56de\u4e09\u4e2a\u7edf\u8ba1\u503c\uff1a\u5f53\u65e5\u3001\u5f53\u6708\u548c\u5f53\u5e74\u7684\u6570\u636e\u6570\u91cf\u3002\u8fd9\u79cd\u5408\u5e76\u540e\u7684\u67e5\u8be2\u63d0\u9ad8\u4e86\u6548\u7387\u5e76\u7b80\u5316\u4e86\u4ee3\u7801\uff0c\u4f7f\u6211\u4eec\u80fd\u591f\u4f7f\u7528\u5355\u6761\u67e5\u8be2\u83b7\u53d6\u6240\u6709\u6240\u9700\u7684\u4fe1\u606f\u3002<\/p>\n<p>\u672c\u7bc7\u5173\u4e8e\u300a\u5982\u4f55\u5c06\u591a\u6761\u65e5\u671f\u533a\u95f4\u7edf\u8ba1\u67e5\u8be2\u5408\u5e76\u4e3a\u5355\u6761\u67e5\u8be2\uff0c\u63d0\u9ad8\u6548\u7387\u5e76\u7b80\u5316\u4ee3\u7801\uff1f\u300b\u7684\u4ecb\u7ecd\u5c31\u5230\u6b64\u7ed3\u675f\u5566\uff0c\u4f46\u662f\u5b66\u65e0\u6b62\u5883\uff0c\u60f3\u8981\u4e86\u89e3\u5b66\u4e60\u66f4\u591a\u5173\u4e8e\u6570\u636e\u5e93\u7684\u76f8\u5173\u77e5\u8bc6\uff0c\u8bf7\u5173\u6ce8\u4e3b\u673a\u5b9d\u8d1d\u516c\u4f17\u53f7\uff01<\/p>\n<dl>\n<dt>\n <\/dt>\n<\/dl>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u4f55\u5c06\u591a\u6761\u65e5\u671f\u533a\u95f4\u7edf\u8ba1\u67e5\u8be2\u5408\u5e76\u4e3a&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[101],"tags":[],"class_list":["post-200227","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/200227","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=200227"}],"version-history":[{"count":0,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/200227\/revisions"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=200227"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=200227"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=200227"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}