name重复的,只保留id号最小的。
delete from
company where (name) in
(select name from company_copy group by name having count(*) > 1)
and id not in (select min(id) from company_copy group by name having count(*)>1)
转载于:https://blog.51cto.com/gjbxx110/517545