网站首页 文章专栏 删除重复
删除重复
编辑时间:2019-04-29 16:19:16.0 作者:hcy 浏览量:67

DELETE from 表 WHERE (id) IN ( SELECT id FROM 表 GROUP BY id HAVING COUNT(id) > 1) AND ROWID NOT IN (SELECT MIN(ROWID) FROM 表 GROUP BY id HAVING COUNT(*) > 1);

 

delete from datamove_msg d where d.m_id in(
select m_Id from datamovyesm_id having count(1)>1
) and rowid not in(
select min(rowid) from datamove_msg group by m_id having count(1)>1
)

来说两句吧
最新评论