DELETE FROM jc_company where name IN ( SELECT t.name FROM ( SELECT name FROM jc_company GROUP BY name HAVING count(1) > 1 ) t )AND id NOT IN (SELECT dt.mindeptno FROM ( SELECT min(id) AS mindeptno FROM jc_company GROUP BY name HAVING count(1) > 1 ) dt)
表名 company
重复列 name
索引 id
网友评论