Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9c00510

Browse files
committed
update: 1 solution
1 parent1db72e4 commit9c00510

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

‎README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Progress: 14/
1616
|181|[Employees Earning More Than Their Managers](https://leetcode.com/problems/employees-earning-more-than-their-managers/)|[SQL](./src/employees-earning-more-than-their-managers/res.txt)|Easy|
1717
|182|[Duplicate Emails](https://leetcode.com/problems/duplicate-emails/)|[SQL](./src/duplicate-emails/res.txt)|Easy|
1818
|184|[Department Highest Salary](https://leetcode.com/problems/department-highest-salary/)|[SQL](./src/department-highest-salary/res.txt)|Medium|
19+
|196|[Delete Duplicate Emails](https://leetcode.com/problems/delete-duplicate-emails/)|[SQL](./src/delete-duplicate-emails/res.txt)|Easy|
1920
|197|[Rising Temperature](https://leetcode.com/problems/rising-temperature/)|[SQL](./src/rising-temperature/res.txt)|Easy|
2021
|342|[Power of Four](https://leetcode.com/problems/power-of-four/)|[JavaScript](./src/power-of-four/res.js)|Easy|
2122
|404|[Sum of Left Leaves](https://leetcode.com/problems/sum-of-left-leaves/)|[JavaScript](./src/sum-of-left-leaves/res.js)|Easy|

‎src/delete-duplicate-emails/res.txt

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
-- Write a SQL query to delete all duplicate email entries in a table named Person, keeping only unique emails based on its smallest Id.
2+
3+
-- +----+------------------+
4+
-- | Id | Email |
5+
-- +----+------------------+
6+
-- | 1 | john@example.com |
7+
-- | 2 | bob@example.com |
8+
-- | 3 | john@example.com |
9+
-- +----+------------------+
10+
-- Id is the primary key column for this table.
11+
-- For example, after running your query, the above Person table should have the following rows:
12+
13+
-- +----+------------------+
14+
-- | Id | Email |
15+
-- +----+------------------+
16+
-- | 1 | john@example.com |
17+
-- | 2 | bob@example.com |
18+
-- +----+------------------+
19+
20+
# Write your MySQL query statement below
21+
DELETE a
22+
FROM Person a, Person b
23+
WHERE a.Email = b.Email AND
24+
a.Id > b.Id;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp