{"id":2566,"date":"2023-10-14T14:34:09","date_gmt":"2023-10-14T06:34:09","guid":{"rendered":"https:\/\/white-night.club\/?p=2566"},"modified":"2023-11-09T11:07:49","modified_gmt":"2023-11-09T03:07:49","slug":"ad50","status":"publish","type":"post","link":"https:\/\/white-night.club\/index.php\/2023\/10\/14\/ad50\/","title":{"rendered":"197.\u00a0\u4e0a\u5347\u7684\u6e29\u5ea6"},"content":{"rendered":"\n<p>\u8868\uff1a&nbsp;<code>Weather<\/code><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">+---------------+---------+\n| Column Name   | Type    |\n+---------------+---------+\n| id            | int     |\n| recordDate    | date    |\n| temperature   | int     |\n+---------------+---------+\nid \u662f\u8be5\u8868\u5177\u6709\u552f\u4e00\u503c\u7684\u5217\u3002\n\u8be5\u8868\u5305\u542b\u7279\u5b9a\u65e5\u671f\u7684\u6e29\u5ea6\u4fe1\u606f<\/pre>\n\n\n\n<p>\u7f16\u5199\u89e3\u51b3\u65b9\u6848\uff0c\u627e\u51fa\u4e0e\u4e4b\u524d\uff08\u6628\u5929\u7684\uff09\u65e5\u671f\u76f8\u6bd4\u6e29\u5ea6\u66f4\u9ad8\u7684\u6240\u6709\u65e5\u671f\u7684&nbsp;<code>id<\/code>&nbsp;\u3002<\/p>\n\n\n\n<p>\u8fd4\u56de\u7ed3\u679c&nbsp;<strong>\u65e0\u987a\u5e8f\u8981\u6c42<\/strong>&nbsp;\u3002<\/p>\n\n\n\n<p>\u7ed3\u679c\u683c\u5f0f\u5982\u4e0b\u4f8b\u5b50\u6240\u793a\u3002<\/p>\n\n\n\n<p><strong>\u793a\u4f8b 1\uff1a<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code><strong>\u8f93\u5165\uff1a<\/strong>\nWeather \u8868\uff1a<\/code>\n+----+------------+-------------+\n| id | recordDate | Temperature |\n+----+------------+-------------+\n| 1  | 2015-01-01 | 10          |\n| 2  | 2015-01-02 | 25          |\n| 3  | 2015-01-03 | 20          |\n| 4  | 2015-01-04 | 30          |\n+----+------------+-------------+\n<strong>\u8f93\u51fa\uff1a<\/strong>\n+----+\n| id |\n+----+\n| 2  |\n| 4  |\n+----+\n<strong>\u89e3\u91ca\uff1a<\/strong>\n2015-01-02 \u7684\u6e29\u5ea6\u6bd4\u524d\u4e00\u5929\u9ad8\uff0810 -&gt; 25\uff09\n2015-01-04 \u7684\u6e29\u5ea6\u6bd4\u524d\u4e00\u5929\u9ad8\uff0820 -&gt; 30\uff09<\/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>DATEDIFF<\/em><\/cite><\/blockquote>\n\n\n\n<p>\u4e3b\u8981\u662f\u5b66\u4e60\u4e0bDATEDIFF\u7684\u7528\u6cd5\u3002DATEDIFF\u80fd\u6bd4\u8f83\u4e24\u4e2adate\u7c7b\u578b\u7684\u6570\u636e\u5e76\u8fd4\u56de\u5b83\u4eec\u7684\u65f6\u95f4\u5dee\uff08\u4ee5\u5929\u4e3a\u5355\u4f4d\uff09<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Write your MySQL query statement below\r\nSELECT A.id FROM Weather AS A\r\nWHERE EXISTS(\r\n    SELECT B.* FROM Weather AS B\r\n    WHERE DATEDIFF(A.recordDate,B.recordDate)=1 AND B.temperature&lt;A.temperature\r\n)<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Leetcode\u9898\u76ee:DATEDIFF<\/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\/2566"}],"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=2566"}],"version-history":[{"count":0,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/posts\/2566\/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=2566"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/categories?post=2566"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/tags?post=2566"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}