{"id":44806,"date":"2024-12-01T14:57:15","date_gmt":"2024-12-01T06:57:15","guid":{"rendered":"https:\/\/fwq.ai\/blog\/44806\/"},"modified":"2024-12-01T14:57:15","modified_gmt":"2024-12-01T06:57:15","slug":"%e5%a6%82%e4%bd%95%e4%bd%bf%e7%94%a8-sql-%e6%9f%a5%e8%af%a2%e6%8c%87%e5%ae%9a%e6%97%a5%e6%9c%9f%e8%8c%83%e5%9b%b4%e5%86%85%e7%9a%84%e8%af%84%e8%ae%ba%e6%95%b0%e6%8d%ae%ef%bc%9f-2","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/44806\/","title":{"rendered":"\u5982\u4f55\u4f7f\u7528 SQL \u67e5\u8be2\u6307\u5b9a\u65e5\u671f\u8303\u56f4\u5185\u7684\u8bc4\u8bba\u6570\u636e\uff1f"},"content":{"rendered":"<p><b><\/b> <\/p>\n<h1>\u5982\u4f55\u4f7f\u7528 SQL \u67e5\u8be2\u6307\u5b9a\u65e5\u671f\u8303\u56f4\u5185\u7684\u8bc4\u8bba\u6570\u636e\uff1f <\/h1>\n<p>\u4eca\u65e5\u4e0d\u80af\u57cb\u5934\uff0c\u660e\u65e5\u4f55\u4ee5\u62ac\u5934\uff01\u6bcf\u65e5\u4e00\u53e5\u52aa\u529b\u81ea\u5df1\u7684\u8bdd\u54c8\u54c8~\u54c8\u55bd\uff0c\u4eca\u5929\u6211\u5c06\u7ed9\u5927\u5bb6\u5e26\u6765\u4e00\u7bc7\uff0c\u4e3b\u8981\u5185\u5bb9\u662f\u8bb2\u89e3\u7b49\u7b49\uff0c\u611f\u5174\u8da3\u7684\u670b\u53cb\u53ef\u4ee5\u6536\u85cf\u6216\u8005\u6709\u66f4\u597d\u7684\u5efa\u8bae\u5728\u8bc4\u8bba\u63d0\u51fa\uff0c\u6211\u90fd\u4f1a\u8ba4\u771f\u770b\u7684\uff01\u5927\u5bb6\u4e00\u8d77\u8fdb\u6b65\uff0c\u4e00\u8d77\u5b66\u4e60\uff01<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241102\/17305261406725bbbc3a0fd.jpg\" class=\"aligncenter\" title=\"\u5982\u4f55\u4f7f\u7528 SQL \u67e5\u8be2\u6307\u5b9a\u65e5\u671f\u8303\u56f4\u5185\u7684\u8bc4\u8bba\u6570\u636e\uff1f\u63d2\u56fe\" alt=\"\u5982\u4f55\u4f7f\u7528 SQL \u67e5\u8be2\u6307\u5b9a\u65e5\u671f\u8303\u56f4\u5185\u7684\u8bc4\u8bba\u6570\u636e\uff1f\u63d2\u56fe\" \/><\/p>\n<p>\u67e5\u8be2\u6307\u5b9a\u65e5\u671f\u8303\u56f4<\/p>\n<p>\u6839\u636e create_time \u65f6\u95f4\u6233\u67e5\u8be2 comment \u8868\u4e2d\u4eca\u65e5\u6307\u5b9a id \u7684\u6570\u636e\u3002<\/p>\n<p><strong>\u67e5\u8be2\u8bed\u53e5\uff1a<\/strong><\/p>\n<pre>select * from comment where to_days(create_time) = to_days(now()) and id = 21;<\/pre>\n<p>\u672c\u7bc7\u5173\u4e8e\u300a\u5982\u4f55\u4f7f\u7528 SQL \u67e5\u8be2\u6307\u5b9a\u65e5\u671f\u8303\u56f4\u5185\u7684\u8bc4\u8bba\u6570\u636e\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\u7c73\u4e91\u516c\u4f17\u53f7\uff01<\/p>\n<dl>\n<dt>\n <\/dt>\n<\/dl>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u4f55\u4f7f\u7528 SQL \u67e5\u8be2\u6307\u5b9a\u65e5\u671f\u8303\u56f4\u5185\u7684\u8bc4\u8bba\u6570\u636e\uff1f \u4eca\u65e5\u4e0d\u80af\u57cb\u5934\uff0c\u660e\u65e5\u4f55\u4ee5\u62ac\u5934\uff01\u6bcf\u65e5\u4e00\u53e5\u52aa\u529b\u81ea\u5df1\u7684\u8bdd\u54c8\u54c8~\u54c8\u55bd\uff0c\u4eca\u5929\u6211\u5c06\u7ed9\u5927\u5bb6\u5e26\u6765\u4e00\u7bc7\uff0c\u4e3b\u8981\u5185\u5bb9\u662f\u8bb2\u89e3\u7b49\u7b49\uff0c\u611f\u5174\u8da3\u7684\u670b\u53cb\u53ef\u4ee5\u6536\u85cf\u6216\u8005\u6709\u66f4\u597d\u7684\u5efa\u8bae\u5728\u8bc4\u8bba\u63d0\u51fa\uff0c\u6211\u90fd\u4f1a\u8ba4\u771f\u770b\u7684\uff01\u5927\u5bb6\u4e00\u8d77\u8fdb\u6b65\uff0c\u4e00\u8d77\u5b66\u4e60\uff01 \u67e5\u8be2\u6307\u5b9a\u65e5\u671f\u8303\u56f4 \u6839\u636e create_time \u65f6\u95f4\u6233\u67e5\u8be2 comment \u8868\u4e2d\u4eca\u65e5\u6307\u5b9a id \u7684\u6570\u636e\u3002 \u67e5\u8be2\u8bed\u53e5\uff1a select * from comment where to_days(create_time) = to_days(now()) and id = 21; \u672c\u7bc7\u5173\u4e8e\u300a\u5982\u4f55\u4f7f\u7528 SQL \u67e5\u8be2\u6307\u5b9a\u65e5\u671f\u8303\u56f4\u5185\u7684\u8bc4\u8bba\u6570\u636e\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\u7c73\u4e91\u516c\u4f17\u53f7\uff01<\/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-44806","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/44806","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=44806"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/44806\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=44806"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=44806"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=44806"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}