sqlcreate table Person(
id int primary key,
email varchar(20)
) ;
<!-- more -->
show tables;
drop table Person;
insert into Person values (1,'join@qq.com'),(2,'join@qq.com'),(3,'qwm@qq.com');
insert into Person values (5,'xwm@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);
select p1.email from Person as p1,
Person as p2 where p1.email=p2.email
and p1.id!=p2.id group by p1.email;
select email from
Person group by email
having count(email) > 1;
本文作者:yowayimono
本文链接:
版权声明:本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!