It is mainly used to record the rowid uniqueness of rows in Oracle.
Remove duplicate records (pay attention to multiple executions until the impact record is 0 rows)
- Delete from WBH_TEMP2 where terminal_id in (
- Select terminal_id from WBH_TEMP2 group by terminal_id having count (*)>1)
- And rowid in (select max (rowid) from WBH_TEMP2 group by terminal_id having count (*)>1)
It is equivalent to the preceding statement. This statement can be executed once to remove duplicate records.
- Delete from WBH_TEMP2 where terminal_id in (
- Select terminal_id from WBH_TEMP2 group by terminal_id having count (*)>1)
- And rowid not in (select min (rowid) from WBH_TEMP2 group by terminal_id having count (*)>1)
We recommend that you use CTAS when there is a large amount of data.
Create table WBH_TEMP3 as select terminal_id from WBH_TEMP2 group by terminal_id
In this way, duplicate records are removed from WBH_TEMP3.