SQL Language (MOSC)

MOSC Banner

Deleting duplicate rows from table violating unique constraint

edited Mar 19, 2019 10:54AM in SQL Language (MOSC) 6 commentsAnswered ✓

Hi,

we have a table with a UNIQUE INDEX on 8 columns

CREATE UNIQUE INDEX EOCDUT_TRX_LINES_MANU_INV_DATE ON TRX_INVOICE_DUTY_OUT

(TRX_ASSIGNED_FILE, MANUFACTURER_ID, COMM_INV_NO, DATE_INVOICE, COMM_INV_LINE_NO, TARIFF_NO, TARIFF_LINE_NO, CHARGE_INDICATOR)

/

We just loaded some data in the table using SQL LOADER and as a result there are duplicate records in the table which made

the above UNIQUE index to be in UNUSABLE state. So we need to DELETE the RECORDS that violate the UNIQUE constraint

Here is the query that gives us the records that violates the UNIQUE constraint

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center