mysql
中调用下面的语句提示该错误
delete from Person where id in (
select t1.id from Person t1, Person t2 where t1.email = t2.email and t1.id > t2.id
);
In MySQL, you can’t modify the same table which you use in the SELECT part.
解决方法:
建立一张临时的中间表
delete from Person where id in (
select id from(
select t1.id as id from Person t1, Person t2 where t1.email = t2.email and t1.id > t2.id
) as tmp
);