1. 程式人生 > >leetcode 196. Delete Duplicate Emails delete

leetcode 196. Delete Duplicate Emails delete

題意:刪除Email重複的行,保留Id最小的行,也就使每個Email只保留Id最小那個

思路:用刪除語句進行刪除

delete p1
from Person as p1, Person as p2
where p1.Id > p2.Id and p1.Email = p2.Email