{"id":2375,"date":"2023-10-12T09:23:44","date_gmt":"2023-10-12T01:23:44","guid":{"rendered":"https:\/\/white-night.club\/?p=2375"},"modified":"2023-11-09T11:07:50","modified_gmt":"2023-11-09T03:07:50","slug":"ad41","status":"publish","type":"post","link":"https:\/\/white-night.club\/index.php\/2023\/10\/12\/ad41\/","title":{"rendered":"181.\u00a0\u8d85\u8fc7\u7ecf\u7406\u6536\u5165\u7684\u5458\u5de5"},"content":{"rendered":"\n<p>\u8868\uff1a<code>Employee<\/code>&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">+-------------+---------+\n| Column Name | Type    |\n+-------------+---------+\n| id          | int     |\n| name        | varchar |\n| salary      | int     |\n| managerId   | int     |\n+-------------+---------+\nid \u662f\u8be5\u8868\u7684\u4e3b\u952e\uff08\u5177\u6709\u552f\u4e00\u503c\u7684\u5217\uff09\u3002\n\u8be5\u8868\u7684\u6bcf\u4e00\u884c\u90fd\u8868\u793a\u96c7\u5458\u7684ID\u3001\u59d3\u540d\u3001\u5de5\u8d44\u548c\u7ecf\u7406\u7684ID\u3002\n<\/pre>\n\n\n\n<p>\u7f16\u5199\u89e3\u51b3\u65b9\u6848\uff0c\u627e\u51fa\u6536\u5165\u6bd4\u7ecf\u7406\u9ad8\u7684\u5458\u5de5\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\u683c\u5f0f\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:<\/strong> \nEmployee \u8868:\n+----+-------+--------+-----------+\n| id | name  | salary | managerId |\n+----+-------+--------+-----------+\n| 1  | Joe   | 70000  | 3         |\n| 2  | Henry | 80000  | 4         |\n| 3  | Sam   | 60000  | Null      |\n| 4  | Max   | 90000  | Null      |\n+----+-------+--------+-----------+\n<strong>\u8f93\u51fa:<\/strong> \n+----------+\n| Employee |\n+----------+\n| Joe      |\n+----------+\n<strong>\u89e3\u91ca:<\/strong> Joe \u662f\u552f\u4e00\u6323\u5f97\u6bd4\u7ecf\u7406\u591a\u7684\u96c7\u5458\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>WHERE EXISTS<\/em><\/cite><\/blockquote>\n\n\n\n<p>\u6211\u4e00\u5f00\u59cb\u4ee5\u4e3a\u662f\u201c\u6323\u7684\u6bd4\u4efb\u610f\u4e00\u4e2a\u7ecf\u7406\u9ad8\u7684\u5458\u5de5\u201d\uff0c\u540e\u9762\u53d1\u73b0Henry\u6ca1\u5728\u8f93\u51fa\u3002\u6240\u4ee5\u4e00\u4e2a\u5458\u5de5\u5bf9\u5e94\u4e00\u4e2a\u7ecf\u7406\uff0c\u6323\u7684\u6bd4\u5176\u5bf9\u5e94\u7684\u7ecf\u7406\u591a\u5c31\u884c\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Write your MySQL query statement below\r\nSELECT A.name AS Employee\r\nFROM Employee AS A\r\nWHERE EXISTS(\r\n  SELECT B.*FROM Employee AS B\r\n  WHERE A.managerId=B.id AND A.salary>B.salary\r\n)<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Leetcode\u9898\u76ee\uff1aWHERE EXISTS<\/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\/2375"}],"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=2375"}],"version-history":[{"count":0,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/posts\/2375\/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=2375"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/categories?post=2375"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/tags?post=2375"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}