删除重复记录

扫码查看
本文介绍了删除重复记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试了一个SQL查询来查找表中重复记录的数量:
从表名称中

I have tried a sql query to find the number of duplicate records in a table:

select count(*) from table_name a
where rowid >(select min(rowid)
                        from table_name b
                     where a.column1=b.column1
and a.Column2 = b.Column2)



这返回了1203行的结果.
现在,当我尝试运行以下查询以删除这些行时,应用程序挂起并停止响应.



This returned me a result of 1203 rows.
Now when i try to run the below query to delete these rows, the application hangs and stops responding.

delete from table_name a
where rowid >select min(rowid)
                        from table_name b
                     where a.column1=b.column1
and a.column2= b.column2)



还有其他方法吗?请帮助



Is there any other way to do it? Please help

推荐答案




这篇关于删除重复记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 13:30
查看更多