这句话意思是:不能先select再更新(修改)同一个表。
可以再外嵌套多一层,这个问题只有mysql有,mssql和oracle都没有。
# 出错
delete from Person
where Id not in (
select min(Id) as Id from Person group by Email);
# 正确
delete from Person
where Id not in (
select Id from (
select min(Id) as Id from Person group by Email) p);