原题: https://leetcode.com/problems/delete-duplicate-emails/description/
题意: 编写SQL删除Person表中所有的重复email条目,只保留Id最小的唯一email记录。
例子:
给定Person表:
+----+------------------+
| Id | Email |
+----+------------------+
| 1 | john@example.com |
| 2 | bob@example.com |
| 3 | john@example.com |
+----+------------------+
Id is the primary key column for this table.
执行查询语句之后,Person表格包含信息如下:
+----+------------------+
| Id | Email |
+----+------------------+
| 1 | john@example.com |
| 2 | bob@example.com |
+----+------------------+