好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

Delete Duplicate Emails

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

标签:

查看更多关于Delete Duplicate Emails的详细内容...

  阅读:19次