也是有两种解法
sqlcreate table Person(
id int primary key,
email varchar(20)
) ;
show tables;
drop table Person;
insert into Person values
(1,'join@qq.com'),(2,'join@qq.com'),(3,'qwm@qq.com');
delete p1 from Person as p1,
Person p2 where p1.email = p2.email
and p1.id > p2.id;
delete from Person where
id not in (select id from
(select min(id) as id from Person group by email) t);
本文作者:yowayimono
本文链接:
版权声明:本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!