delete
from `wuye`
where wuye_id in (
select * from (
select wuye_id from `wuye` where wuye_name in (
select wuye_name from `wuye` group by wuye_name having count(*)>1
)
)`a`
)
and wuye_id not in (
select * from (
select min(wuye_id) from `wuye` group by wuye_name having count(*)>1
)`b`
)
标签:count,group,name,记录,保留,mysql,wuye,id,select
From: https://www.cnblogs.com/sunr/p/16978154.html