본문 바로가기
python-algorithm

leetcode 196. Delete Duplicate Emails

by 무적김두칠 2023. 1. 29.

https://leetcode.com/problems/delete-duplicate-emails/description/

 

Delete Duplicate Emails - LeetCode

Delete Duplicate Emails - Table: Person +-------------+---------+ | Column Name | Type | +-------------+---------+ | id | int | | email | varchar | +-------------+---------+ id is the primary key column for this table. Each row of this table contains an em

leetcode.com

 

1
2
3
4
5
6
7
# Please write a DELETE statement and DO NOT write a SELECT statement.
# Write your MySQL query statement below
DELETE t1 FROM Person t1
INNER JOIN Person t2 
WHERE 
    t1.id > t2.id AND 
    t1.email = t2.email
cs
반응형

댓글