sql删除重复数据
Posted liuxinxin4288
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sql删除重复数据相关的知识,希望对你有一定的参考价值。
DELETE FROM city_info WHERE 1=1 AND admin_id IN ( SELECT * from ( SELECT admin_id FROM city_info GROUP BY admin_id HAVING COUNT(admin_id)>1 ) as A) AND id NOT IN ( SELECT * from ( SELECT MIN(id) FROM city_info GROUP BY admin_id HAVING COUNT(admin_id)>1 ) as B)
以上是关于sql删除重复数据的主要内容,如果未能解决你的问题,请参考以下文章