{"id":200451,"date":"2025-05-06T12:18:46","date_gmt":"2025-05-06T04:18:46","guid":{"rendered":"https:\/\/server.hk\/cnblog\/200451\/"},"modified":"2025-05-06T12:18:46","modified_gmt":"2025-05-06T04:18:46","slug":"%e4%b8%ba%e4%bb%80%e4%b9%88%e6%88%91%e7%9a%84-sql-%e6%9b%b4%e6%96%b0%e6%93%8d%e4%bd%9c%e5%81%b6%e5%b0%94%e4%bc%9a%e6%8a%a5-error-invalid-input-syntax-for-integer-0-00-%e9%94%99","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/200451\/","title":{"rendered":"\u4e3a\u4ec0\u4e48\u6211\u7684 SQL \u66f4\u65b0\u64cd\u4f5c\u5076\u5c14\u4f1a\u62a5 \\&#8221;ERROR: invalid input syntax for integer: \\&#8221;0.00\\&#8221;\\&#8221; \u9519\u8bef\uff1f"},"content":{"rendered":"<p><b><\/b> <\/p>\n<h1>\u4e3a\u4ec0\u4e48\u6211\u7684 SQL \u66f4\u65b0\u64cd\u4f5c\u5076\u5c14\u4f1a\u62a5 \\&#8221;ERROR: invalid input syntax for integer: \\&#8221;0.00\\&#8221;\\&#8221; \u9519\u8bef\uff1f<\/h1>\n<p>\u79ef\u7d2f\u77e5\u8bc6\uff0c\u80dc\u8fc7\u79ef\u84c4\u91d1\u94f6\uff01\u6bd5\u7adf\u5728\u6570\u636e\u5e93\u5f00\u53d1\u7684\u8fc7\u7a0b\u4e2d\uff0c\u4f1a\u9047\u5230\u5404\u79cd\u5404\u6837\u7684\u95ee\u9898\uff0c\u5f80\u5f80\u90fd\u662f\u4e00\u4e9b\u7ec6\u8282\u77e5\u8bc6\u70b9\u8fd8\u6ca1\u6709\u638c\u63e1\u597d\u800c\u5bfc\u81f4\u7684\uff0c\u56e0\u6b64\u57fa\u7840\u77e5\u8bc6\u70b9\u7684\u79ef\u7d2f\u662f\u5f88\u91cd\u8981\u7684\u3002\u4e0b\u9762\u672c\u6587\u300a\u4e3a\u4ec0\u4e48\u6211\u7684 SQL \u66f4\u65b0\u64cd\u4f5c\u5076\u5c14\u4f1a\u62a5 \\&#8221;ERROR: invalid input syntax for integer: \\&#8221;0.00\\&#8221;\\&#8221; \u9519\u8bef\uff1f\u300b\uff0c\u5c31\u5e26\u5927\u5bb6\u8bb2\u89e3\u4e00\u4e0b\u77e5\u8bc6\u70b9\uff0c\u82e5\u662f\u4f60\u5bf9\u672c\u6587\u611f\u5174\u8da3\uff0c\u6216\u8005\u662f\u60f3\u641e\u61c2\u5176\u4e2d\u67d0\u4e2a\u77e5\u8bc6\u70b9\uff0c\u5c31\u8bf7\u4f60\u7ee7\u7eed\u5f80\u4e0b\u770b\u5427~<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241105\/17307934646729cff8a4319.jpg\" class=\"aligncenter\"><\/p>\n<p><strong>SQL \u66f4\u65b0\u51fa\u73b0\u95f4\u6b47\u6027\u9519\u8bef\uff1a&#8221;ERROR: invalid input syntax for integer: &#8220;0.00&#8221;\uff1f&#8221;<\/strong><\/p>\n<p>\u63d0\u95ee\u8005\u9047\u5230\u4e86\u4e00\u4e2a SQL \u66f4\u65b0\u64cd\u4f5c\u5076\u5c14\u62a5\u9519\u7684\u60c5\u51b5\uff0c\u5177\u4f53\u9519\u8bef\u4fe1\u606f\u4e3a\uff1a&#8221;ERROR: invalid input syntax for integer: &#8220;0.00&#8221;&#8221;.<\/p>\n<p>\u8be2\u95ee\u540e\u5f97\u77e5\uff0c\u6570\u636e\u5e93\u4e2d\u53d7\u5f71\u54cd\u5b57\u6bb5\u7684\u7c7b\u578b\u4e3a numeric\uff0c\u957f\u5ea6\u4e3a 0\uff0c\u5c0f\u6570\u70b9\u4e3a 0\u3002\u4f46\u66f4\u65b0\u64cd\u4f5c\u65f6\u5374\u62a5\u51fa\u6574\u6570\u9519\u8bef\u3002<\/p>\n<p><strong>\u89e3\u7b54\uff1a<\/strong><\/p>\n<p>\u8fd9\u4e2a\u95ee\u9898\u53ef\u80fd\u662f\u7531\u4ee5\u4e0b\u539f\u56e0\u5f15\u8d77\u7684\uff1a<\/p>\n<p>\u5728 Java \u4ee3\u7801\u4e2d\uff0c\u4f20\u9012\u7684\u53c2\u6570\u7c7b\u578b\u4e0d\u6b63\u786e\u3002\u5177\u4f53\u6765\u8bf4\uff0c\u4f60\u4f20\u9012\u4e86\u4e00\u4e2a\u6d6e\u70b9\u5b57\u7b26\u4e32\u53c2\u6570\uff0c\u800c PostgreSQL \u5728\u7c7b\u578b\u8f6c\u6362\u65f6\u65e0\u6cd5\u8bc6\u522b\u5b83\u3002<\/p>\n<p>\u5982\u679c\u4f60\u4e0d\u5e26 &#8220;.00&#8243;\uff0cPostgreSQL \u5c31\u53ef\u4ee5\u8bc6\u522b\u53c2\u6570\u5e76\u6210\u529f\u66f4\u65b0\u3002<\/p>\n<p><strong>\u5efa\u8bae\uff1a<\/strong><\/p>\n<p>\u8c03\u6574 Java \u4ee3\u7801\u4e2d\u53c2\u6570\u7684\u7c7b\u578b\uff0c\u4f7f\u5176\u4e0e\u6570\u636e\u5e93\u4e2d\u53d7\u5f71\u54cd\u5b57\u6bb5\u7684\u7c7b\u578b\u5339\u914d\u3002\u5982\u679c\u4f60\u7684\u5b57\u6bb5\u7c7b\u578b\u662f numeric \u4e14\u6ca1\u6709\u5c0f\u6570\u70b9\uff0c\u8bf7\u4f20\u9012\u4e00\u4e2a\u6574\u6570\u53c2\u6570\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u672c\u6587\u7684\u5168\u90e8\u5185\u5bb9\u4e86\uff0c\u662f\u5426\u6709\u987a\u5229\u5e2e\u52a9\u4f60\u89e3\u51b3\u95ee\u9898\uff1f\u82e5\u662f\u80fd\u7ed9\u4f60\u5e26\u6765\u5b66\u4e60\u4e0a\u7684\u5e2e\u52a9\uff0c\u8bf7\u5927\u5bb6\u591a\u591a\u652f\u6301\u4e3b\u673a\u5b9d\u8d1d\uff01\u66f4\u591a\u5173\u4e8e\u6570\u636e\u5e93\u7684\u76f8\u5173\u77e5\u8bc6\uff0c\u4e5f\u53ef\u5173\u6ce8\u4e3b\u673a\u5b9d\u8d1d\u516c\u4f17\u53f7\u3002<\/p>\n<dl>\n<dt>\n <\/dt>\n<\/dl>\n","protected":false},"excerpt":{"rendered":"<p>\u4e3a\u4ec0\u4e48\u6211\u7684 SQL \u66f4\u65b0\u64cd\u4f5c\u5076\u5c14&#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-200451","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/200451","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=200451"}],"version-history":[{"count":0,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/200451\/revisions"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=200451"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=200451"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=200451"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}