{"id":26909,"date":"2024-11-24T10:53:23","date_gmt":"2024-11-24T02:53:23","guid":{"rendered":"https:\/\/fwq.ai\/blog\/26909\/"},"modified":"2024-11-24T10:53:23","modified_gmt":"2024-11-24T02:53:23","slug":"mysql-%e6%9f%a5%e8%af%a2%e4%b8%ad%e5%88%ab%e5%90%8d-temp-%e4%b8%ba%e4%bd%95%e8%bf%94%e5%9b%9e-null%ef%bc%9f-2","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/26909\/","title":{"rendered":"MySQL \u67e5\u8be2\u4e2d\u522b\u540d temp \u4e3a\u4f55\u8fd4\u56de NULL\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173112534427401.jpg\" class=\"aligncenter\" title=\"MySQL \u67e5\u8be2\u4e2d\u522b\u540d temp \u4e3a\u4f55\u8fd4\u56de NULL\uff1f\u63d2\u56fe\" alt=\"MySQL \u67e5\u8be2\u4e2d\u522b\u540d temp \u4e3a\u4f55\u8fd4\u56de NULL\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong> \u67e5\u8be2\u4e2d\u522b\u540d temp \u8fd4\u56de null<\/strong><\/p>\n<p>\u95ee\u9898\uff1a\u5728 mysql \u67e5\u8be2\u4e2d\uff0c\u4f7f\u7528\u4ee5\u4e0b\u8bed\u53e5\u67e5\u8be2\u522b\u540d\u4e3a temp \u7684\u5217\u65f6\uff0c\u5374\u8fd4\u56de\u4e86 null\uff1a<\/p>\n<pre>select str_to_date(plan_start_time, '%h:%i:%s') as temp,plan_start_time from base_stop_calendar<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u80cc\u666f\u4fe1\u606f\uff1a<\/p>\n<ul>\n<li>temp \u662f\u522b\u540d\uff0c\u5e76\u975e\u622a\u56fe\u9519\u8bef\u3002<\/li>\n<li>plan_start_time \u662f varchar \u7c7b\u578b\u3002<\/li>\n<\/ul>\n<p>\u89e3\u7b54\uff1a<\/p>\n<p>\u5728\u63d0\u4f9b\u7684 sql \u8bed\u53e5\u4e2d\uff0c\u683c\u5f0f\u5316\u5b57\u7b26 &#8220;%h&#8221; \u7528\u4e8e\u8868\u793a\u5c0f\u65f6\uff0812 \u5c0f\u65f6\u5236\uff09\u3002\u7136\u800c\uff0cplan_start_time \u5217\u4e2d\u5b58\u50a8\u7684\u662f 24 \u5c0f\u65f6\u5236\u7684\u65f6\u95f4\uff0c\u56e0\u6b64\u4f7f\u7528 &#8220;%h&#8221; \u4f1a\u5bfc\u81f4\u683c\u5f0f\u5316\u5931\u8d25\uff0c\u4ece\u800c\u8fd4\u56de null\u3002<\/p>\n<p>\u89e3\u51b3\u65b9\u6848\uff1a<\/p>\n<p>\u8981\u6b63\u786e\u5730\u683c\u5f0f\u5316\u8ba1\u5212\u5f00\u59cb\u65f6\u95f4\uff0c\u5e94\u8be5\u4f7f\u7528\u5927\u5199\u5b57\u6bcd &#8220;h&#8221; \u6765\u8868\u793a 24 \u5c0f\u65f6\u5236\u7684\u65f6\u95f4\u3002\u4ee5\u4e0b\u662f\u4fee\u6539\u540e\u7684 sql \u8bed\u53e5\uff1a<\/p>\n<pre>select str_to_date(plan_start_time, '%h:%i:%s') as temp,plan_start_time from base_stop_calendar<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4f7f\u7528\u6b64\u8bed\u53e5\u540e\uff0c\u522b\u540d temp \u5c06\u8fd4\u56de\u683c\u5f0f\u6b63\u786e\u7684\u65e5\u671f\u548c\u65f6\u95f4\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fMySQL \u67e5\u8be2\u4e2d\u522b\u540d temp \u4e3a\u4f55\u8fd4\u56de NULL\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\u4e2d\u522b\u540d temp \u8fd4\u56de null \u95ee\u9898\uff1a\u5728 mysql \u67e5\u8be2\u4e2d\uff0c\u4f7f\u7528\u4ee5\u4e0b\u8bed\u53e5\u67e5\u8be2\u522b\u540d\u4e3a temp \u7684\u5217\u65f6\uff0c\u5374\u8fd4\u56de\u4e86 null\uff1a select str_to_date(plan_start_time, &#8216;%h:%i:%s&#8217;) as temp,plan_start_time from base_stop_calendar \u767b\u5f55\u540e\u590d\u5236 \u767b\u5f55\u540e\u590d\u5236 \u80cc\u666f\u4fe1\u606f\uff1a temp \u662f\u522b\u540d\uff0c\u5e76\u975e\u622a\u56fe\u9519\u8bef\u3002 plan_start_time \u662f varchar \u7c7b\u578b\u3002 \u89e3\u7b54\uff1a \u5728\u63d0\u4f9b\u7684 sql \u8bed\u53e5\u4e2d\uff0c\u683c\u5f0f\u5316\u5b57\u7b26 &#8220;%h&#8221; \u7528\u4e8e\u8868\u793a\u5c0f\u65f6\uff0812 \u5c0f\u65f6\u5236\uff09\u3002\u7136\u800c\uff0cplan_start_time \u5217\u4e2d\u5b58\u50a8\u7684\u662f 24 \u5c0f\u65f6\u5236\u7684\u65f6\u95f4\uff0c\u56e0\u6b64\u4f7f\u7528 &#8220;%h&#8221; \u4f1a\u5bfc\u81f4\u683c\u5f0f\u5316\u5931\u8d25\uff0c\u4ece\u800c\u8fd4\u56de null\u3002 \u89e3\u51b3\u65b9\u6848\uff1a \u8981\u6b63\u786e\u5730\u683c\u5f0f\u5316\u8ba1\u5212\u5f00\u59cb\u65f6\u95f4\uff0c\u5e94\u8be5\u4f7f\u7528\u5927\u5199\u5b57\u6bcd &#8220;h&#8221; \u6765\u8868\u793a 24 \u5c0f\u65f6\u5236\u7684\u65f6\u95f4\u3002\u4ee5\u4e0b\u662f\u4fee\u6539\u540e\u7684 sql \u8bed\u53e5\uff1a select str_to_date(plan_start_time, &#8216;%h:%i:%s&#8217;) as temp,plan_start_time from base_stop_calendar \u767b\u5f55\u540e\u590d\u5236 [&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-26909","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/26909","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=26909"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/26909\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=26909"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=26909"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=26909"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}