//删除重复数据保留id最小的一条
DELETE FROM related_party
WHERE company_name IN ( select a.company_name from (SELECT company_name FROM related_party GROUP BY company_name
HAVING count( company_name ) > 1) a)
AND
id NOT IN (select a.id from (SELECT min(id) as id FROM related_party GROUP BY company_name
HAVING count( company_name ) > 1) a);