8000 solve problem Delete Duplicate Emails · P-ppc/leetcode@f778823 · GitHub
[go: up one dir, main page]

Skip to content

Commit f778823

Browse files
committed
solve problem Delete Duplicate Emails
1 parent 8b41587 commit f778823

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,4 +324,5 @@ All solutions will be accepted!
324324
|596|[Big Countries](https://leetcode-cn.com/problems/big-countries/description/)|[mysql](./database/BigCountries)|Easy|
325325
|182|[Duplicate Emails](https://leetcode-cn.com/problems/duplicate-emails/description/)|[mysql](./database/DuplicateEmails)|Easy|
326326
|596|[Classes More Than 5 Students](https://leetcode-cn.com/problems/classes-more-than-5-students/description/)|[mysql](./ClassesMoreThan5Students)|Easy|
327-
|620|[Not Boring Movies](https://leetcode-cn.com/problems/not-boring-movies/description/)|[mysql](./database/NotBoringMovies)|Easy|
327+
|620|[Not Boring Movies](https://leetcode-cn.com/problems/not-boring-movies/description/)|[mysql](./database/NotBoringMovies)|Easy|
328+
|196|[Delete Duplicate Emails](https://leetcode-cn.com/problems/delete-duplicate-emails/description/)|[mysql](./database/DeleteDuplicateEmails)|Easy|
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Delete Duplicate Emails
2+
We can solve this problem by GROUP BY and temp table
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Write your MySQL query statement below
2+
delete from Person where Id not in (
3+
select temp.Id from (
4+
select min(Id) as Id from Person group by Email
5+
)
6+
as temp
7+
)

0 commit comments

Comments
 (0)
0