{ "data": { "question": { "questionId": "182", "questionFrontendId": "182", "categoryTitle": "Database", "boundTopicId": 1357, "title": "Duplicate Emails", "titleSlug": "duplicate-emails", "content": "
Table: Person
\n+-------------+---------+\n| Column Name | Type |\n+-------------+---------+\n| id | int |\n| email | varchar |\n+-------------+---------+\nid is the primary key column for this table.\nEach row of this table contains an email. The emails will not contain uppercase letters.\n\n\n
\n\n
Write an SQL query to report all the duplicate emails.
\n\nReturn the result table in any order.
\n\nThe query result format is in the following example.
\n\n\n
Example 1:
\n\n\nInput: \nPerson table:\n+----+---------+\n| id | email |\n+----+---------+\n| 1 | a@b.com |\n| 2 | c@d.com |\n| 3 | a@b.com |\n+----+---------+\nOutput: \n+---------+\n| Email |\n+---------+\n| a@b.com |\n+---------+\nExplanation: a@b.com is repeated two times.\n\n", "translatedTitle": "查找重复的电子邮箱", "translatedContent": "
编写一个 SQL 查询,查找 Person
表中所有重复的电子邮箱。
示例:
\n\n+----+---------+\n| Id | Email |\n+----+---------+\n| 1 | a@b.com |\n| 2 | c@d.com |\n| 3 | a@b.com |\n+----+---------+\n\n\n
根据以上输入,你的查询应返回以下结果:
\n\n+---------+\n| Email |\n+---------+\n| a@b.com |\n+---------+\n\n\n
说明:所有电子邮箱都是小写字母。
\n", "isPaidOnly": false, "difficulty": "Easy", "likes": 354, "dislikes": 0, "isLiked": null, "similarQuestions": "[]", "contributors": [], "langToValidPlayground": "{\"cpp\": false, \"java\": false, \"python\": false, \"python3\": false, \"mysql\": false, \"mssql\": false, \"oraclesql\": false, \"c\": false, \"csharp\": false, \"javascript\": false, \"ruby\": false, \"bash\": false, \"swift\": false, \"golang\": false, \"scala\": false, \"html\": false, \"pythonml\": false, \"kotlin\": false, \"rust\": false, \"php\": false, \"typescript\": false, \"racket\": false, \"erlang\": false, \"elixir\": false}", "topicTags": [ { "name": "Database", "slug": "database", "translatedName": "数据库", "__typename": "TopicTagNode" } ], "companyTagStats": null, "codeSnippets": [ { "lang": "MySQL", "langSlug": "mysql", "code": "# Write your MySQL query statement below", "__typename": "CodeSnippetNode" }, { "lang": "MS SQL Server", "langSlug": "mssql", "code": "/* Write your T-SQL query statement below */", "__typename": "CodeSnippetNode" }, { "lang": "Oracle", "langSlug": "oraclesql", "code": "/* Write your PL/SQL query statement below */", "__typename": "CodeSnippetNode" } ], "stats": "{\"totalAccepted\": \"222.2K\", \"totalSubmission\": \"280.2K\", \"totalAcceptedRaw\": 222192, \"totalSubmissionRaw\": 280173, \"acRate\": \"79.3%\"}", "hints": [], "solution": { "id": "103", "canSeeDetail": true, "__typename": "ArticleNode" }, "status": null, "sampleTestCase": "{\"headers\": {\"Person\": [\"Id\", \"Email\"]}, \"rows\": {\"Person\": [[1, \"a@b.com\"], [2, \"c@d.com\"], [3, \"a@b.com\"]]}}", "metaData": "{\n \"mysql\": [\n \"Create table If Not Exists Person (id int, email varchar(255))\"\n ],\n \"mssql\": [\n \"Create table Person (id int, email varchar(255))\"\n ],\n \"oraclesql\": [\n \"Create table Person (id int, email varchar(255))\"\n ],\n \"database\": true\n}", "judgerAvailable": true, "judgeType": "large", "mysqlSchemas": [ "Create table If Not Exists Person (id int, email varchar(255))", "Truncate table Person", "insert into Person (id, email) values ('1', 'a@b.com')", "insert into Person (id, email) values ('2', 'c@d.com')", "insert into Person (id, email) values ('3', 'a@b.com')" ], "enableRunCode": true, "envInfo": "{\"mysql\":[\"MySQL\",\"\\u7248\\u672c\\uff1a mssql server 2019.<\\/p>\"],\"oraclesql\":[\"Oracle\",\" Oracle Sql 11.2.<\\/p>\"]}",
"book": null,
"isSubscribed": false,
"isDailyQuestion": false,
"dailyRecordStatus": null,
"editorType": "CKEDITOR",
"ugcQuestionId": null,
"style": "LEETCODE",
"exampleTestcases": "{\"headers\": {\"Person\": [\"id\", \"email\"]}, \"rows\": {\"Person\": [[1, \"a@b.com\"], [2, \"c@d.com\"], [3, \"a@b.com\"]]}}",
"__typename": "QuestionNode"
}
}
}MySQL 8.0<\\/code><\\/p>\"],\"mssql\":[\"MS SQL Server\",\"