196. 删除重复的电子邮箱 + delete
196. 删除重复的电子邮箱
LeetCode_MySql_196
题目描述
实现代码
# Write your MySQL query statement below
# 需要找到两张表中,其他记录中具有相同邮件地址但是id更大的记录,将其删除即可
delete p1
from
Person p1, Person p2
where
p1.Email = p2.Email
and p1.Id > p2.Id;
Either Excellent or Rusty