{"id":2633,"date":"2023-10-16T11:07:09","date_gmt":"2023-10-16T03:07:09","guid":{"rendered":"https:\/\/white-night.club\/?p=2633"},"modified":"2023-11-09T11:07:49","modified_gmt":"2023-11-09T03:07:49","slug":"ad58","status":"publish","type":"post","link":"https:\/\/white-night.club\/index.php\/2023\/10\/16\/ad58\/","title":{"rendered":"182.\u00a0\u67e5\u627e\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\uff08\u5177\u6709\u552f\u4e00\u503c\u7684\u5217\uff09\u3002\n\u6b64\u8868\u7684\u6bcf\u4e00\u884c\u90fd\u5305\u542b\u4e00\u5c01\u7535\u5b50\u90ae\u4ef6\u3002\u7535\u5b50\u90ae\u4ef6\u4e0d\u5305\u542b\u5927\u5199\u5b57\u6bcd\u3002\n<\/pre>\n\n\n\n<p>\u7f16\u5199\u89e3\u51b3\u65b9\u6848\u6765\u62a5\u544a\u6240\u6709\u91cd\u590d\u7684\u7535\u5b50\u90ae\u4ef6\u3002 \u8bf7\u6ce8\u610f\uff0c\u53ef\u4ee5\u4fdd\u8bc1\u7535\u5b50\u90ae\u4ef6\u5b57\u6bb5\u4e0d\u4e3a NULL\u3002<\/p>\n\n\n\n<p>\u4ee5&nbsp;<strong>\u4efb\u610f\u987a\u5e8f&nbsp;<\/strong>\u8fd4\u56de\u7ed3\u679c\u8868\u3002<\/p>\n\n\n\n<p>\u7ed3\u679c\u683c\u5f0f\u5982\u4e0b\u4f8b\u3002<\/p>\n\n\n\n<p><strong>\u793a\u4f8b&nbsp;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  | a@b.com |\n| 2  | c@d.com |\n| 3  | a@b.com |\n+----+---------+\n<strong>\u8f93\u51fa:<\/strong> \n+---------+\n| Email   |\n+---------+\n| a@b.com |\n+---------+\n<strong>\u89e3\u91ca:<\/strong> a@b.com \u51fa\u73b0\u4e86\u4e24\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>GROUP BY\u548cHAVING\u7684\u7528\u6cd5<\/em><\/cite><\/blockquote>\n\n\n\n<p>\u5de9\u56fa\u4e00\u4e0bGROUP BY\u7684\u7528\u6cd5\u3002<\/p>\n\n\n\n<p>\u5148\u6839\u636eGROUP BY\u5bf9\u6570\u636e\u8fdb\u884c\u5206\u7ec4\uff0c\u518d\u7528HAVING\u7b5b\u9009\u6570\u636e\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Write your MySQL query statement below\r\nSELECT A.email AS Email\r\nFROM Person AS A\r\nGROUP BY email \r\nHAVING COUNT(email)>1<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Leetcode\u9898\u76ee\uff1aGROUP BY\u548cCOUNT<\/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\/2633"}],"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=2633"}],"version-history":[{"count":0,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/posts\/2633\/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=2633"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/categories?post=2633"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/tags?post=2633"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}