语法:
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-2024 8a.hk All Rights Reserved. 八艾云 版权所有 中山市八艾云计算有限公司 粤ICP备14095776号 粤公网安备 44200002445359号
增值电信业务经营许可证编号:B1-20222012
代理域名注册服务机构:西部数码