{"id":5334,"date":"2024-11-14T10:15:30","date_gmt":"2024-11-14T02:15:30","guid":{"rendered":"https:\/\/fwq.ai\/blog\/5334\/"},"modified":"2024-11-14T10:15:30","modified_gmt":"2024-11-14T02:15:30","slug":"oracle%e6%97%a5%e6%9c%9f%e6%af%94%e8%be%83%e6%80%8e%e4%b9%88%e5%86%99","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/5334\/","title":{"rendered":"oracle\u65e5\u671f\u6bd4\u8f83\u600e\u4e48\u5199"},"content":{"rendered":"<blockquote><p>\n  oracle \u4e2d\u6bd4\u8f83\u65e5\u671f\u6709\u4e24\u79cd\u65b9\u6cd5\uff1a\u76f4\u63a5\u6bd4\u8f83\uff0c\u4f7f\u7528\u6bd4\u8f83\u8fd0\u7b97\u7b26\uff08=\u3001&gt;\u3001\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202405\/26\/2024052619454844741.jpg\" class=\"aligncenter\" title=\"oracle\u65e5\u671f\u6bd4\u8f83\u600e\u4e48\u5199\u63d2\u56fe\" alt=\"oracle\u65e5\u671f\u6bd4\u8f83\u600e\u4e48\u5199\u63d2\u56fe\" \/><\/p>\n<p><strong>Oracle \u4e2d\u6bd4\u8f83\u65e5\u671f\u7684\u65b9\u6cd5<\/strong><\/p>\n<p>\u5728 Oracle \u4e2d\u6bd4\u8f83\u65e5\u671f\u6709\u4e24\u79cd\u4e3b\u8981\u65b9\u6cd5\uff1a<\/p>\n<p><strong>1. \u76f4\u63a5\u6bd4\u8f83<\/strong><\/p>\n<p>\u6700\u76f4\u63a5\u7684\u65b9\u6cd5\u662f\u4f7f\u7528\u6bd4\u8f83\u8fd0\u7b97\u7b26\uff0c\u4f8b\u5982\uff1a<\/p>\n<pre>SELECT * FROM table_name\nWHERE date_column = '2023-03-08';\n\nSELECT * FROM table_name\nWHERE date_column &gt; '2023-03-01';\n\nSELECT * FROM table_name\nWHERE date_column &lt; '2023-04-30';<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>2. \u4f7f\u7528 DATE_ADD() \u51fd\u6570<\/strong><\/p>\n<p>\u6b64\u51fd\u6570\u5141\u8bb8\u60a8\u5c06\u5929\u6570\u3001\u6708\u4efd\u6216\u5e74\u4efd\u6dfb\u52a0\u5230\u6216\u4ece\u65e5\u671f\u4e2d\u51cf\u53bb\uff0c\u7136\u540e\u8fdb\u884c\u6bd4\u8f83\uff1a<\/p>\n<pre>SELECT * FROM table_name\nWHERE date_column &gt; DATE_ADD('2023-03-01', INTERVAL 1 MONTH);\n\nSELECT * FROM table_name\nWHERE date_column &lt; DATE_ADD('2023-04-30', INTERVAL -5 DAYS);<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u5176\u4ed6\u6ce8\u610f\u4e8b\u9879\uff1a<\/strong><\/p>\n<ul>\n<li>Oracle \u4f7f\u7528 DATE \u6570\u636e\u7c7b\u578b\u6765\u5b58\u50a8\u65e5\u671f\u548c\u65f6\u95f4\u503c\u3002<\/li>\n<li>\u6bd4\u8f83\u65f6\uff0c\u65f6\u95f4\u7684\u6bd4\u8f83\u5c06\u88ab\u5ffd\u7565\u3002<\/li>\n<li>\u65e5\u671f\u503c\u53ef\u4ee5\u5305\u542b\u5c0f\u6570\u90e8\u5206\uff0c\u4ee5\u8868\u793a\u65f6\u95f4\uff08\u4f8b\u5982\uff0c&#8217;2023-03-08 12:30:00.000&#8217;\uff09\u3002<\/li>\n<li>\u60a8\u8fd8\u53ef\u4ee5\u4f7f\u7528 BETWEEN \u8fd0\u7b97\u7b26\u6765\u6bd4\u8f83\u65e5\u671f\u662f\u5426\u5728\u6307\u5b9a\u8303\u56f4\u4e4b\u5185\u3002<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662f\u65e5\u671f\u6bd4\u8f83\u600e\u4e48\u5199\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u7f51\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>oracle \u4e2d\u6bd4\u8f83\u65e5\u671f\u6709\u4e24\u79cd\u65b9\u6cd5\uff1a\u76f4\u63a5\u6bd4\u8f83\uff0c\u4f7f\u7528\u6bd4\u8f83\u8fd0\u7b97\u7b26\uff08=\u3001&gt;\u3001 Oracle \u4e2d\u6bd4\u8f83\u65e5\u671f\u7684\u65b9\u6cd5 \u5728 Oracle \u4e2d\u6bd4\u8f83\u65e5\u671f\u6709\u4e24\u79cd\u4e3b\u8981\u65b9\u6cd5\uff1a 1. \u76f4\u63a5\u6bd4\u8f83 \u6700\u76f4\u63a5\u7684\u65b9\u6cd5\u662f\u4f7f\u7528\u6bd4\u8f83\u8fd0\u7b97\u7b26\uff0c\u4f8b\u5982\uff1a SELECT * FROM table_name WHERE date_column = &#8216;2023-03-08&#8217;; SELECT * FROM table_name WHERE date_column &gt; &#8216;2023-03-01&#8217;; SELECT * FROM table_name WHERE date_column &lt; &#8216;2023-04-30&#8217;; \u767b\u5f55\u540e\u590d\u5236 2. \u4f7f\u7528 DATE_ADD() \u51fd\u6570 \u6b64\u51fd\u6570\u5141\u8bb8\u60a8\u5c06\u5929\u6570\u3001\u6708\u4efd\u6216\u5e74\u4efd\u6dfb\u52a0\u5230\u6216\u4ece\u65e5\u671f\u4e2d\u51cf\u53bb\uff0c\u7136\u540e\u8fdb\u884c\u6bd4\u8f83\uff1a SELECT * FROM table_name WHERE date_column &gt; DATE_ADD(&#8216;2023-03-01&#8217;, INTERVAL 1 MONTH); SELECT * FROM table_name [&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-5334","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/5334","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=5334"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/5334\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=5334"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=5334"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=5334"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}