Skip to content

Commit 20d6a80

Browse files
committed
Sync LeetCode submission Runtime - 823 ms (32.79%), Memory - 0B (100.00%)
1 parent 93333f6 commit 20d6a80

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

0182-duplicate-emails/README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<p>Table: <code>Person</code></p>
2+
3+
<pre>
4+
+-------------+---------+
5+
| Column Name | Type |
6+
+-------------+---------+
7+
| id | int |
8+
| email | varchar |
9+
+-------------+---------+
10+
id is the primary key (column with unique values) for this table.
11+
Each row of this table contains an email. The emails will not contain uppercase letters.
12+
</pre>
13+
14+
<p>&nbsp;</p>
15+
16+
<p>Write a solution to report all the duplicate emails. Note that it&#39;s guaranteed that the email&nbsp;field is not NULL.</p>
17+
18+
<p>Return the result table in <strong>any order</strong>.</p>
19+
20+
<p>The&nbsp;result format is in the following example.</p>
21+
22+
<p>&nbsp;</p>
23+
<p><strong class="example">Example 1:</strong></p>
24+
25+
<pre>
26+
<strong>Input:</strong>
27+
Person table:
28+
+----+---------+
29+
| id | email |
30+
+----+---------+
31+
| 1 | a@b.com |
32+
| 2 | c@d.com |
33+
| 3 | a@b.com |
34+
+----+---------+
35+
<strong>Output:</strong>
36+
+---------+
37+
| Email |
38+
+---------+
39+
| a@b.com |
40+
+---------+
41+
<strong>Explanation:</strong> a@b.com is repeated two times.
42+
</pre>

0182-duplicate-emails/solution.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Write your MySQL query statement below
2+
SELECT email as Email FROM Person GROUP BY Email HAVING COUNT(*) > 1;

0 commit comments

Comments
 (0)