📜  mysql 删除重复项 - SQL 代码示例

📅  最后修改于: 2022-03-11 15:04:56.111000             🧑  作者: Mango

代码示例6
delete test
   from test
  inner join (
     select max(id) as lastId, email
       from test
      group by email
     having count(*) > 1) duplic on duplic.email = test.email
  where test.id < duplic.lastId;