We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7f0abc7 commit 65c3c20Copy full SHA for 65c3c20
LeetcodeProblems/Databases/Duplicate_emails.sql
@@ -0,0 +1,24 @@
1
+/*
2
+Easy
3
+
4
+Write a SQL query to find all duplicate emails in a table named Person.
5
6
++----+---------+
7
+| Id | Email |
8
9
+| 1 | a@b.com |
10
+| 2 | c@d.com |
11
+| 3 | a@b.com |
12
13
+For example, your query should return the following for the above table:
14
15
++---------+
16
+| Email |
17
18
+| a@b.com |
19
20
+*/
21
+SELECT Email
22
+FROM Person p
23
+group by Email
24
+having count(Email) > 1
0 commit comments