[LeetCode][SQL]Duplicate Emails

https://leetcode.com/problems/duplicate-emails/

Duplicate Emails

Write a SQL query to find all duplicate emails in a table named Person.

+----+---------+
| Id | Email   |
+----+---------+
| 1  | [email protected] |
| 2  | [email protected] |
| 3  | [email protected] |
+----+---------+

For example, your query should return the following for the above table:

+---------+
| Email   |
+---------+
| [email protected] |
+---------+



select Email from Person group by Email having count(*) > 1
时间: 2024-10-14 02:00:02

[LeetCode][SQL]Duplicate Emails的相关文章

[LeetCode] Delete Duplicate Emails 删除重复邮箱

Write a SQL query to delete all duplicate email entries in a table named Person, keeping only unique emails based on its smallest Id. +----+------------------+ | Id | Email | +----+------------------+ | 1 | [email protected] | | 2 | [email protected]

【Leetcode】Duplicate Emails

题目链接:https://leetcode.com/problems/duplicate-emails/ 题目: Write a SQL query to find all duplicate emails in a table named Person. +--+---+ | Id | Email | +--+---+ | 1 | [email protected] | | 2 | [email protected] | | 3 | [email protected] | +--+---+ F

leetcode 182. Duplicate Emails

传送门 182. Duplicate Emails My Submissions Question Total Accepted: 14498 Total Submissions: 38364 Difficulty: Easy Write a SQL query to find all duplicate emails in a table named Person. +----+---------+ | Id | Email | +----+---------+ | 1 | [email pr

LeetCode:Duplicate Emails - 重复出现的Email

1.题目名称 Duplicate Emails(重复出现的Email) 2.题目地址 https://leetcode.com/problems/duplicate-emails/ 3.题目内容 有一个数据表包括Id和Email两列,找出数据表内Email列内容重复出现的Email数据. 例如,现有一个表Person内容如下: +----+---------+ | Id | Email   | +----+---------+ | 1  | [email protected] | | 2  | 

LeetCode - Delete Duplicate Emails

Discription:Write a SQL query to delete all duplicate email entries in a table named Person, keeping only unique emails based on its smallest Id. 删除重复的Email地址,保留Id最小的那个. 使用自身连接循环即可. # Write your MySQL query statement below delete p1 from Person p1, P

LeetCode 182. Duplicate Emails (查找重复的电子邮箱)

题目标签: 题目给了我们一个 email 的table,让我们找到重复的 email. 可以建立 Person a, Person b, 找到两个表格中,emai 相等 但是 id 不同的 email, 然后利用DISTINCT 返回,因为两个表格中,会找到两个 重复的email. Java Solution: Runtime:  224 ms, faster than 40 % Memory Usage: N/A 完成日期:06/01/2019 关键点:用DISTINCT # Write yo

[LeetCode][SQL]Delete Duplicate Emails

https://leetcode.com/problems/delete-duplicate-emails/ Delete Duplicate Emails Write a SQL query to delete all duplicate email entries in a table named Person, keeping only unique emails based on its smallest Id. +----+------------------+ | Id | Emai

[LeetCode] [SQL]: 182: Duplicate Emails

题目: Write a SQL query to find all duplicate emails in a table named Person. +----+---------+ | Id | Email | +----+---------+ | 1 | [email protected] | | 2 | [email protected] | | 3 | [email protected] | +----+---------+ For example, your query should

[LeetCode] Duplicate Emails 重复的邮箱

Write a SQL query to find all duplicate emails in a table named Person. +----+---------+ | Id | Email | +----+---------+ | 1 | [email protected] | | 2 | [email protected] | | 3 | [email protected] | +----+---------+ For example, your query should ret