{"id":2152,"date":"2023-10-07T10:39:27","date_gmt":"2023-10-07T02:39:27","guid":{"rendered":"https:\/\/white-night.club\/?p=2152"},"modified":"2023-11-09T11:07:51","modified_gmt":"2023-11-09T03:07:51","slug":"ad29","status":"publish","type":"post","link":"https:\/\/white-night.club\/index.php\/2023\/10\/07\/ad29\/","title":{"rendered":"1148.\u00a0\u6587\u7ae0\u6d4f\u89c8 I"},"content":{"rendered":"\n<p><code>Views<\/code>&nbsp;\u8868\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">+---------------+---------+\n| Column Name   | Type    |\n+---------------+---------+\n| article_id    | int     |\n| author_id     | int     |\n| viewer_id     | int     |\n| view_date     | date    |\n+---------------+---------+\n\u6b64\u8868\u53ef\u80fd\u4f1a\u5b58\u5728\u91cd\u590d\u884c\u3002\uff08\u6362\u53e5\u8bdd\u8bf4\uff0c\u5728 SQL \u4e2d\u8fd9\u4e2a\u8868\u6ca1\u6709\u4e3b\u952e\uff09\n\u6b64\u8868\u7684\u6bcf\u4e00\u884c\u90fd\u8868\u793a\u67d0\u4eba\u5728\u67d0\u5929\u6d4f\u89c8\u4e86\u67d0\u4f4d\u4f5c\u8005\u7684\u67d0\u7bc7\u6587\u7ae0\u3002\n\u8bf7\u6ce8\u610f\uff0c\u540c\u4e00\u4eba\u7684 author_id \u548c viewer_id \u662f\u76f8\u540c\u7684\u3002\n<\/pre>\n\n\n\n<p>\u8bf7\u67e5\u8be2\u51fa\u6240\u6709\u6d4f\u89c8\u8fc7\u81ea\u5df1\u6587\u7ae0\u7684\u4f5c\u8005<\/p>\n\n\n\n<p>\u7ed3\u679c\u6309\u7167&nbsp;<code>id<\/code>&nbsp;\u5347\u5e8f\u6392\u5217\u3002<\/p>\n\n\n\n<p>\u67e5\u8be2\u7ed3\u679c\u7684\u683c\u5f0f\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n\n\n\n<p><strong>\u793a\u4f8b 1\uff1a<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>\u8f93\u5165\uff1a<\/strong>\nViews \u8868\uff1a\n+------------+-----------+-----------+------------+\n| article_id | author_id | viewer_id | view_date  |\n+------------+-----------+-----------+------------+\n| 1          | 3         | 5         | 2019-08-01 |\n| 1          | 3         | 6         | 2019-08-02 |\n| 2          | 7         | 7         | 2019-08-01 |\n| 2          | 7         | 6         | 2019-08-02 |\n| 4          | 7         | 1         | 2019-07-22 |\n| 3          | 4         | 4         | 2019-07-21 |\n| 3          | 4         | 4         | 2019-07-21 |\n+------------+-----------+-----------+------------+\n\n<strong>\u8f93\u51fa\uff1a<\/strong>\n+------+\n| id   |\n+------+\n| 4    |\n| 7    |\n+------+<\/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>\u6392\u5e8f\u8fd4\u56de<\/em><\/cite><\/blockquote>\n\n\n\n<p>\u518d\u6c34\u4e2aSQL\u9898\u3002\u4e3b\u8981\u662f\u8bb0\u5f55\u4e0border by\u7684\u7528\u6cd5\u3002order by\u540e\u9762\u8981\u5148\u8ddf\u5217\u540d\u518d\u8ddfASC\uff08ascend\uff09\u6216DESC\uff08descend\uff09\uff0cASC\u5c31\u662f\u6211\u4eec\u5e38\u7528\u7684\u5347\u5e8f\u6392\u5217\uff0c\u4ece\u4e0a\u81f3\u4e0b\u4f9d\u6b21\u589e\u5927\u3002DESC\u5219\u76f8\u53cd\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Write your MySQL query statement below\r\nSELECT DISTINCT author_id AS id FROM Views\r\nWHERE author_id=viewer_id\r\nORDER BY author_id ASC<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Leetcode\u9898\u76ee\uff1aORDER BY &#8230; ASC|DESC<\/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\/2152"}],"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=2152"}],"version-history":[{"count":0,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/posts\/2152\/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=2152"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/categories?post=2152"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/tags?post=2152"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}