{"id":2630,"date":"2023-10-16T10:55:59","date_gmt":"2023-10-16T02:55:59","guid":{"rendered":"https:\/\/white-night.club\/?p=2630"},"modified":"2023-11-09T11:07:49","modified_gmt":"2023-11-09T03:07:49","slug":"ad57","status":"publish","type":"post","link":"https:\/\/white-night.club\/index.php\/2023\/10\/16\/ad57\/","title":{"rendered":"196.\u00a0\u5220\u9664\u91cd\u590d\u7684\u7535\u5b50\u90ae\u7bb1"},"content":{"rendered":"\n<p>\u8868:&nbsp;<code>Person<\/code><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">+-------------+---------+\n| Column Name | Type    |\n+-------------+---------+\n| id          | int     |\n| email       | varchar |\n+-------------+---------+\nid \u662f\u8be5\u8868\u7684\u4e3b\u952e\u5217(\u5177\u6709\u552f\u4e00\u503c\u7684\u5217)\u3002\n\u8be5\u8868\u7684\u6bcf\u4e00\u884c\u5305\u542b\u4e00\u5c01\u7535\u5b50\u90ae\u4ef6\u3002\u7535\u5b50\u90ae\u4ef6\u5c06\u4e0d\u5305\u542b\u5927\u5199\u5b57\u6bcd\u3002\n<\/pre>\n\n\n\n<p>\u7f16\u5199\u89e3\u51b3\u65b9\u6848<strong>&nbsp;\u5220\u9664<\/strong>&nbsp;\u6240\u6709\u91cd\u590d\u7684\u7535\u5b50\u90ae\u4ef6\uff0c\u53ea\u4fdd\u7559\u4e00\u4e2a\u5177\u6709\u6700\u5c0f&nbsp;<code>id<\/code>&nbsp;\u7684\u552f\u4e00\u7535\u5b50\u90ae\u4ef6\u3002<\/p>\n\n\n\n<p>\uff08\u5bf9\u4e8e SQL \u7528\u6237\uff0c\u8bf7\u6ce8\u610f\u4f60\u5e94\u8be5\u7f16\u5199\u4e00\u4e2a&nbsp;<code>DELETE<\/code>&nbsp;\u8bed\u53e5\u800c\u4e0d\u662f&nbsp;<code>SELECT<\/code>&nbsp;\u8bed\u53e5\u3002\uff09<\/p>\n\n\n\n<p>\uff08\u5bf9\u4e8e Pandas \u7528\u6237\uff0c\u8bf7\u6ce8\u610f\u4f60\u5e94\u8be5\u76f4\u63a5\u4fee\u6539&nbsp;<code>Person<\/code>&nbsp;\u8868\u3002\uff09<\/p>\n\n\n\n<p>\u8fd0\u884c\u811a\u672c\u540e\uff0c\u663e\u793a\u7684\u7b54\u6848\u662f&nbsp;<code>Person<\/code>&nbsp;\u8868\u3002\u9a71\u52a8\u7a0b\u5e8f\u5c06\u9996\u5148\u7f16\u8bd1\u5e76\u8fd0\u884c\u60a8\u7684\u4ee3\u7801\u7247\u6bb5\uff0c\u7136\u540e\u518d\u663e\u793a&nbsp;<code>Person<\/code>&nbsp;\u8868\u3002<code>Person<\/code>&nbsp;\u8868\u7684\u6700\u7ec8\u987a\u5e8f&nbsp;<strong>\u65e0\u5173\u7d27\u8981<\/strong>&nbsp;\u3002<\/p>\n\n\n\n<p>\u8fd4\u56de\u7ed3\u679c\u683c\u5f0f\u5982\u4e0b\u793a\u4f8b\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> \nPerson \u8868:\n+----+------------------+\n| id | email            |\n+----+------------------+\n| 1  | john@example.com |\n| 2  | bob@example.com  |\n| 3  | john@example.com |\n+----+------------------+\n<strong>\u8f93\u51fa:<\/strong> \n+----+------------------+\n| id | email            |\n+----+------------------+\n| 1  | john@example.com |\n| 2  | bob@example.com  |\n+----+------------------+\n<strong>\u89e3\u91ca:<\/strong> john@example.com\u91cd\u590d\u4e24\u6b21\u3002\u6211\u4eec\u4fdd\u7559\u6700\u5c0f\u7684Id = 1\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>DELETE<\/em><\/cite><\/blockquote>\n\n\n\n<p>\u8865\u5145\u4e00\u4e0bDELETE\u7684\u7528\u6cd5\u3002<\/p>\n\n\n\n<p class=\"has-text-align-center\"><em><strong>DELETE A FROM table AS A<\/strong><\/em><\/p>\n\n\n\n<p>\u56e0\u4e3aDELETE\u5220\u7684\u662f\u4e00\u6574\u884c\uff0c\u76f8\u5f53\u4e8e\u5220\u7684\u662f\u4e00\u4e2a\u5bf9\u8c61\u3002\u6240\u4ee5\u4e0d\u80fd\u5355\u72ec\u5220\u6389\u67d0\u4e00\u5217\u7684\u6570\u636e\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Write your MySQL query statement below\r\nDELETE B \r\nFROM Person AS A,Person AS B\r\nWHERE A.id&lt;B.id AND A.email=B.email<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Leetcode\u9898\u76ee\uff1aDELETE\u7684\u7528\u6cd5<\/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\/2630"}],"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=2630"}],"version-history":[{"count":0,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/posts\/2630\/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=2630"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/categories?post=2630"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/tags?post=2630"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}