当前位置:Gxlcms > 数据库问题 > [LeetCode][SQL]Delete Duplicate Emails

[LeetCode][SQL]Delete Duplicate Emails

时间:2021-07-01 10:21:17 帮助过:3人阅读

link table A.Email = B.Email first !!!! delete A from Person A, Person B where A.Email = B.Email and A.Id > B.Id

 

delete语句里不能再select这个表,这种写法是过不了的。

delete A from Person A where A.Email in (select B.Email from Person B group by B.Email having count(*) > 1)

 

[LeetCode][SQL]Delete Duplicate Emails

标签:

人气教程排行