{"id":3989,"date":"2023-11-02T08:53:54","date_gmt":"2023-11-02T00:53:54","guid":{"rendered":"https:\/\/white-night.club\/?p=3989"},"modified":"2023-11-09T11:07:43","modified_gmt":"2023-11-09T03:07:43","slug":"ad119","status":"publish","type":"post","link":"https:\/\/white-night.club\/index.php\/2023\/11\/02\/ad119\/","title":{"rendered":"1173.\u00a0\u5373\u65f6\u98df\u7269\u914d\u9001 I"},"content":{"rendered":"\n<p>\u914d\u9001\u8868:&nbsp;<code>Delivery<\/code><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">+-----------------------------+---------+\n| Column Name                 | Type    |\n+-----------------------------+---------+\n| delivery_id                 | int     |\n| customer_id                 | int     |\n| order_date                  | date    |\n| customer_pref_delivery_date | date    |\n+-----------------------------+---------+\ndelivery_id \u662f\u8868\u7684\u4e3b\u952e(\u5177\u6709\u552f\u4e00\u503c\u7684\u5217)\u3002\n\u8be5\u8868\u4fdd\u5b58\u7740\u987e\u5ba2\u7684\u98df\u7269\u914d\u9001\u4fe1\u606f\uff0c\u987e\u5ba2\u5728\u67d0\u4e2a\u65e5\u671f\u4e0b\u4e86\u8ba2\u5355\uff0c\u5e76\u6307\u5b9a\u4e86\u4e00\u4e2a\u671f\u671b\u7684\u914d\u9001\u65e5\u671f\uff08\u548c\u4e0b\u5355\u65e5\u671f\u76f8\u540c\u6216\u8005\u5728\u90a3\u4e4b\u540e\uff09\u3002\n<\/pre>\n\n\n\n<p>\u5982\u679c\u987e\u5ba2\u671f\u671b\u7684\u914d\u9001\u65e5\u671f\u548c\u4e0b\u5355\u65e5\u671f\u76f8\u540c\uff0c\u5219\u8be5\u8ba2\u5355\u79f0\u4e3a \u300c\u5373\u65f6\u8ba2\u5355\u300d\uff0c\u5426\u5219\u79f0\u4e3a\u300c\u8ba1\u5212\u8ba2\u5355\u300d\u3002<\/p>\n\n\n\n<p>\u7f16\u5199\u89e3\u51b3\u65b9\u6848\u7edf\u8ba1\u5373\u65f6\u8ba2\u5355\u6240\u5360\u7684\u767e\u5206\u6bd4\uff0c&nbsp;<strong>\u4fdd\u7559\u4e24\u4f4d\u5c0f\u6570\u3002<\/strong><\/p>\n\n\n\n<p>\u8fd4\u56de\u7ed3\u679c\u5982\u4e0b\u6240\u793a\u3002<\/p>\n\n\n\n<p><strong>\u793a\u4f8b 1:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>\u8f93\u5165\uff1a<\/strong>\nDelivery \u8868:\n+-------------+-------------+------------+-----------------------------+\n| delivery_id | customer_id | order_date | customer_pref_delivery_date |\n+-------------+-------------+------------+-----------------------------+\n| 1           | 1           | 2019-08-01 | 2019-08-02                  |\n| 2           | 5           | 2019-08-02 | 2019-08-02                  |\n| 3           | 1           | 2019-08-11 | 2019-08-11                  |\n| 4           | 3           | 2019-08-24 | 2019-08-26                  |\n| 5           | 4           | 2019-08-21 | 2019-08-22                  |\n| 6           | 2           | 2019-08-11 | 2019-08-13                  |\n+-------------+-------------+------------+-----------------------------+\n<strong>\u8f93\u51fa\uff1a<\/strong>\n+----------------------+\n| immediate_percentage |\n+----------------------+\n| 33.33                |\n+----------------------+\n<strong>\u89e3\u91ca\uff1a<\/strong>2 \u548c 3 \u53f7\u8ba2\u5355\u4e3a\u5373\u65f6\u8ba2\u5355\uff0c\u5176\u4ed6\u7684\u4e3a\u8ba1\u5212\u8ba2\u5355\u3002<\/pre>\n\n\n\n<div style=\"height:60px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<blockquote class=\"wp-block-quote has-luminous-vivid-amber-color has-text-color\">\n<p>\u89e3\u9898\u601d\u8def<\/p>\n<cite><em>COUNT*100<\/em><\/cite><\/blockquote>\n\n\n\n<p>\u81ea\u4ece\u628a\u80fd\u5f53\u7ed3\u679c\u96c6\u7684\u90e8\u5206\u90fd\u5f53\u7ed3\u679c\u96c6\u6765\u770b\uff0c\u5f88\u591a\u9898\u60f3\u8d77\u6765\u5feb\u4e86\u4e0d\u5c11\u3002\u6bd4\u5982\u8fd9\u9898\uff0cCOUNT\u5373\u65f6\u8ba1\u5212\u5f88\u7b80\u5355\uff0c\u95ee\u9898\u662f\u76f8\u9664\u6574\u4f53\u6bd4\u8f83\u9ebb\u70e6\u3002<\/p>\n\n\n\n<p>\u90a3\u6211\u76f4\u63a5\u628a\u76f8\u9664\u5f53\u6210\u53e6\u4e00\u4e2a\u7ed3\u679c\u96c6\u7b5b\u9009\u540e\u7684\u7ed3\u679c\u53bb\u770b\uff0c\u9664\u6570\u90a3\u91cc\u76f4\u63a5\u5199\u4e2aselect\u5b8c\u4e8b\u3002\u8fd9\u9898\u8fd8\u9700\u8981\u8fd4\u56de\u767e\u5206\u6bd4\uff0c\u90a3\u5c31\u4e0a\u9762\u4e58100\u5148\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Write your MySQL query statement below\r\nSELECT ROUND(COUNT(A.delivery_id)*100\/(SELECT COUNT(*) FROM Delivery),2) AS immediate_percentage\r\nFROM Delivery AS A \r\nWHERE A.order_date=A.customer_pref_delivery_date<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Leetcode\u9898\u76ee\uff1aCOUNT<\/p>\n","protected":false},"author":1,"featured_media":2827,"comment_status":"open","ping_status":"","sticky":false,"template":"base","format":"standard","meta":{"footnotes":""},"categories":[42,25],"tags":[38],"_links":{"self":[{"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/posts\/3989"}],"collection":[{"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/comments?post=3989"}],"version-history":[{"count":0,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/posts\/3989\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/media\/2827"}],"wp:attachment":[{"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/media?parent=3989"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/categories?post=3989"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/tags?post=3989"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}