Agus Maloco
Agus Maloco

Reputation: 11

How to delete duplicate records in from multiple tables in SQL oracle?

in the image, these are the records in my tables from two different tables which are linked together through the "CUSTABN". As the records from these tables are duplicated, so I want to delete all the duplicate records.

Records from multiple tables (Customer & Invoice)

enter image description here

Can anyone help?

Upvotes: 0

Views: 1013

Answers (1)

M.mhr
M.mhr

Reputation: 1749

If your tables are related with foreign key field "CUSTABN", I think this is what you want :

DELETE T1, T2 FROM T1 JOIN T2 ON T1.CUSTABN = T2.CUSTABN WHERE ...

Upvotes: 1

Related Questions