{"id":3301,"date":"2023-10-25T09:05:23","date_gmt":"2023-10-25T01:05:23","guid":{"rendered":"https:\/\/white-night.club\/?p=3301"},"modified":"2023-11-09T11:07:46","modified_gmt":"2023-11-09T03:07:46","slug":"ad93","status":"publish","type":"post","link":"https:\/\/white-night.club\/index.php\/2023\/10\/25\/ad93\/","title":{"rendered":"1050.\u00a0\u5408\u4f5c\u8fc7\u81f3\u5c11\u4e09\u6b21\u7684\u6f14\u5458\u548c\u5bfc\u6f14"},"content":{"rendered":"\n<p><code>ActorDirector<\/code>&nbsp;\u8868\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">+-------------+---------+\n| Column Name | Type    |\n+-------------+---------+\n| actor_id    | int     |\n| director_id | int     |\n| timestamp   | int     |\n+-------------+---------+\ntimestamp \u662f\u8fd9\u5f20\u8868\u7684\u4e3b\u952e(\u5177\u6709\u552f\u4e00\u503c\u7684\u5217).\n<\/pre>\n\n\n\n<p>\u7f16\u5199\u89e3\u51b3\u65b9\u6848\u627e\u51fa\u5408\u4f5c\u8fc7\u81f3\u5c11\u4e09\u6b21\u7684\u6f14\u5458\u548c\u5bfc\u6f14\u7684 id \u5bf9&nbsp;<code>(actor_id, director_id)<\/code><\/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>\nActorDirector \u8868\uff1a\n+-------------+-------------+-------------+\n| actor_id    | director_id | timestamp   |\n+-------------+-------------+-------------+\n| 1           | 1           | 0           |\n| 1           | 1           | 1           |\n| 1           | 1           | 2           |\n| 1           | 2           | 3           |\n| 1           | 2           | 4           |\n| 2           | 1           | 5           |\n| 2           | 1           | 6           |\n+-------------+-------------+-------------+\n<strong>\u8f93\u51fa\uff1a<\/strong>\n+-------------+-------------+\n| actor_id    | director_id |\n+-------------+-------------+\n| 1           | 1           |\n+-------------+-------------+\n<strong>\u89e3\u91ca\uff1a<\/strong>\n\u552f\u4e00\u7684 id \u5bf9\u662f (1, 1)\uff0c\u4ed6\u4eec\u6070\u597d\u5408\u4f5c\u4e86 3 \u6b21\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>\u76f8\u5173\u5b50\u67e5\u8be2<\/em><\/cite><\/blockquote>\n\n\n\n<p>\u672c\u6765\u60f3\u4e0d\u7528\u76f8\u5173\u5b50\u67e5\u8be2\u5199\uff0c\u7528\u81ea\u8054\u7ed3\u6216\u8005\u5176\u4ed6\u7684\u65b9\u5f0f\u5199\uff0c\u4f46\u6700\u540e\u8fd8\u662f\u7ed5\u56de\u5230\u76f8\u5173\u5b50\u67e5\u8be2\u4e86\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Write your MySQL query statement below\r\nSELECT DISTINCT A.actor_id,A.director_id\r\nFROM ActorDirector AS A \r\nWHERE EXISTS(\r\n  SELECT B.actor_id,B.director_id\r\n  FROM ActorDirector AS B \r\n  WHERE A.actor_id=B.actor_id AND A.director_id=B.director_id\r\n  HAVING COUNT(B.actor_id)>=3 OR COUNT(B.director_id)>=3\r\n\r\n)\r\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Leetcode\u9898\u76ee\uff1a\u76f8\u5173\u5b50\u67e5\u8be2<\/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\/3301"}],"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=3301"}],"version-history":[{"count":0,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/posts\/3301\/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=3301"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/categories?post=3301"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/tags?post=3301"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}