语法:
DELETE FROM 表名
WHERE id NOT IN (
SELECT temp.min_id FROM (
SELECT MIN(id) min_id FROM 表名
GROUP BY 字段名
)AS temp
);
备注:id:也是表字段
实例:
DELETE FROM pro_completed_table
WHERE id NOT IN (
SELECT temp.min_id FROM (
SELECT MIN(id) min_id FROM pro_completed_table
GROUP BY md5
)AS temp
);
Copyright © 2013-2021 8a.hk All Rights Reserved. 八艾云 版权所有 中山市八艾云计算有限公司 粤ICP备14095776号