Delete duplicate rows in a table

In case you want to identify duplicates and remove them from a table. 1. Identify duplicates. select count(*) from RF_BUSINESS_UNIT_HISTORY WHERE ROWID IN (select rowid from RF_BUSINESS_UNIT_HISTORY MINUS select max(rowid) from RF_BUSINESS_UNIT_HISTORY GROUP BY CALENDAR_YEAR_MONTH,BUSINESS_UNIT_NO,BUSINESS_UNIT_NAME); COUNT(*) ———- 2528 2. 2258 duplicates exist – these can be deleted with command below – delete from RF_BUSINESS_UNIT_HISTORY WHERE […]

Social media & sharing icons powered by UltimatelySocial
Back To Top

Add A Knowledge Base Question !

You will receive an email when your question will be answered.

+ = Verify Human or Spambot ?