oracle删除重复内容(Oracle删除重复内容)
In normal work, you may encounter an attempt to create a unique index on a column or column has a ROWID pseudo column that identifies the unique identity row and provides fast access to a particular row. The maximum (max) or minimum (min) function can be used to determine duplicate rows easily.
1) use the max function to find duplicate rows
SQL>select, columnl, column2, column3, from, table name, a
Where ROWID
2) use the Min function to find duplicate rows
SQL>select, columnl, column2, column3, from, table name, a
Where rowid> (select min (ROWID) from table name
Where columnl=a. columnl and column2=a. column2
And, colum3=a. colum3, and...);
However, when the table is large (for example, more than 500 thousand), the efficiency of this approach is intolerable.
[b]3. [/b][b] lookup duplicate rows by defining integrity constraints [/b]
Define a integrity constraint, integrity constraint is a rule that limits the values of one or more columns in the base table. A unique keyword can be specified by defining the UNIQUE constraint on the table. To satisfy this constraint, the same value cannot be included in the unique keyword column.
Therefore, you can use the EXCEPTIONS INTO clause to store records that violate the activation integrity constraint in a table (EXCEPTIONS), which must be built before using this option. You can get duplicate record
oracle删除重复内容Oracle删除重复内容 来自淘豆网www.taodocs.com转载请标明出处.