LeetCode 196. Delete Duplicate Emails (删除重复的电子邮箱)
题目标签:
题目给了我们一个 email 的表格,让我们删除重复的。
建立Person p1,Person p2,当email 相同时,而且 p1 id 要大于 p2 id 时候,删除这一行。
Java Solution:
Runtime: 869 ms, faster than 33 %
Memory Usage: N/A
完成日期:06/01/2019
关键点:p1.Id > p2.Id
# Write your MySQL query statement below DELETE p1 FROM Person p1, Person p2 WHERE p1.Email = p2.Email AND p1.Id > p2.Id;
LeetCode 题目列表 - LeetCode Questions List
题目来源:https://leetcode.com/