删除重复数据时,子句中包含了要删除的表,会报错,我们需要将子查询条件再包一层就可以了
delete from poi where id in ( select id from ( select * from poi where poi_id in ( select poi_id from poi group by poi_id having count(poi_id) >1 ) and id not in (select min(id) from poi group by poi_id having count(poi_id)>1) ) a );