{"id":4860,"date":"2023-11-12T13:09:04","date_gmt":"2023-11-12T05:09:04","guid":{"rendered":"https:\/\/white-night.club\/?p=4860"},"modified":"2023-11-12T13:10:31","modified_gmt":"2023-11-12T05:10:31","slug":"ad146","status":"publish","type":"post","link":"https:\/\/white-night.club\/index.php\/2023\/11\/12\/ad146\/","title":{"rendered":"1141.\u00a0\u67e5\u8be2\u8fd130\u5929\u6d3b\u8dc3\u7528\u6237\u6570"},"content":{"rendered":"\n<p>\u8868\uff1a<code>Activity<\/code>+&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;+ | Column Name | Type | +&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;+ | user_id | int | | session_id | int | | activity_date | date | | activity_type | enum | +&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;+ \u8be5\u8868\u6ca1\u6709\u5305\u542b\u91cd\u590d\u6570\u636e\u3002 activity_type \u5217\u662f ENUM(category) \u7c7b\u578b\uff0c \u4ece (&#8216;open_session&#8217;\uff0c &#8216;end_session&#8217;\uff0c &#8216;scroll_down&#8217;\uff0c &#8216;send_message&#8217;) \u53d6\u503c\u3002 \u8be5\u8868\u8bb0\u5f55\u793e\u4ea4\u5a92\u4f53\u7f51\u7ad9\u7684\u7528\u6237\u6d3b\u52a8\u3002 \u6ce8\u610f\uff0c\u6bcf\u4e2a\u4f1a\u8bdd\u53ea\u5c5e\u4e8e\u4e00\u4e2a\u7528\u6237\u3002<\/p>\n\n\n\n<p>\u7f16\u5199\u89e3\u51b3\u65b9\u6848\uff0c\u7edf\u8ba1\u622a\u81f3&nbsp;<code>2019-07-27<\/code>\uff08\u5305\u542b2019-07-27\uff09\uff0c\u8fd1<strong>&nbsp;<\/strong><code>30<\/code>&nbsp;\u5929\u7684\u6bcf\u65e5\u6d3b\u8dc3\u7528\u6237\u6570\uff08\u5f53\u5929\u53ea\u8981\u6709\u4e00\u6761\u6d3b\u52a8\u8bb0\u5f55\uff0c\u5373\u4e3a\u6d3b\u8dc3\u7528\u6237\uff09\u3002<\/p>\n\n\n\n<p>\u4ee5&nbsp;<strong>\u4efb\u610f\u987a\u5e8f<\/strong>&nbsp;\u8fd4\u56de\u7ed3\u679c\u8868\u3002<\/p>\n\n\n\n<p>\u7ed3\u679c\u793a\u4f8b\u5982\u4e0b\u3002<\/p>\n\n\n\n<p><strong>\u793a\u4f8b 1:<\/strong><strong>\u8f93\u5165\uff1a<\/strong> Activity table: +&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;+ | user_id | session_id | activity_date | activity_type | +&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;+ | 1 | 1 | 2019-07-20 | open_session | | 1 | 1 | 2019-07-20 | scroll_down | | 1 | 1 | 2019-07-20 | end_session | | 2 | 4 | 2019-07-20 | open_session | | 2 | 4 | 2019-07-21 | send_message | | 2 | 4 | 2019-07-21 | end_session | | 3 | 2 | 2019-07-21 | open_session | | 3 | 2 | 2019-07-21 | send_message | | 3 | 2 | 2019-07-21 | end_session | | 4 | 3 | 2019-06-25 | open_session | | 4 | 3 | 2019-06-25 | end_session | +&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;+ <strong>\u8f93\u51fa\uff1a<\/strong> +&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8211;+ | day | active_users | +&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8211;+ | 2019-07-20 | 2 | | 2019-07-21 | 2 | +&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8211;+ <strong>\u89e3\u91ca\uff1a<\/strong>\u6ce8\u610f\u975e\u6d3b\u8dc3\u7528\u6237\u7684\u8bb0\u5f55\u4e0d\u9700\u8981\u5c55\u793a<\/p>\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 has-link-color wp-elements-0c3aaa1d30969958ebf9aed9167f6b3d\">\n<p>\u89e3\u9898\u601d\u8def<\/p>\n<cite><em>\u6478\u9c7c\u9898<\/em><\/cite><\/blockquote>\n\n\n\n<p>\u4eca\u5929\u5468\u672b\uff0c\u6765\u9053\u7b80\u5355\u7684\u6478\u9c7c\u9898\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Write your MySQL query statement below\r\nSELECT activity_date AS day,COUNT(DISTINCT user_id) AS active_users\r\nFROM Activity \r\nWHERE activity_date&lt;='2019-07-27' AND activity_date>'2019-06-27'\r\nGROUP BY activity_date<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Leetcode\u9898\u76ee\uff1a\u6478\u9c7c\u9898<\/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\/4860"}],"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=4860"}],"version-history":[{"count":0,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/posts\/4860\/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=4860"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/categories?post=4860"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/tags?post=4860"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}