Skip to content

Commit b1605a2

Browse files
refactor 196
1 parent 22ecb7d commit b1605a2

File tree

1 file changed

+0
-20
lines changed

1 file changed

+0
-20
lines changed

database/_196.sql

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1 @@
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-
7-
8-
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-
17-
18-
-- +----+------------------+
19-
20-
-- # Write your MySQL query statement below
211
delete p1 from Person p1, Person p2 where p1.Email = p2.Email and p1.Id > p2.Id

0 commit comments

Comments
 (0)