DELETE
FROM
table_name
WHERE
id NOT IN (
SELECT
t.id
FROM
( SELECT MIN( id ) AS id FROM table_name GROUP BY name ) t
)
MySQL 大批量插入,过滤掉重复数据
于 2021-08-19 09:53:18 首次发布
DELETE
FROM
table_name
WHERE
id NOT IN (
SELECT
t.id
FROM
( SELECT MIN( id ) AS id FROM table_name GROUP BY name ) t
)