Removing duplicate rows from table in Oracle(从Oracle中的表中删除重复行)
问题描述
我正在 Oracle 中测试一些东西并用一些示例数据填充了一个表,但在此过程中我不小心加载了重复记录,所以现在我无法使用某些列创建主键.
I'm testing something in Oracle and populated a table with some sample data, but in the process I accidentally loaded duplicate records, so now I can't create a primary key using some of the columns.
如何删除所有重复的行并只保留其中一个?
How can I delete all duplicate rows and leave only one of them?
推荐答案
使用 rowid
伪列.
其中 column1
、column2
和 column3
构成每条记录的标识键.您可以列出所有列.
Where column1
, column2
, and column3
make up the identifying key for each record. You might list all your columns.
这篇关于从Oracle中的表中删除重复行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!