Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

delete duplicate record

sushovanFeb 23 2011 — edited Feb 24 2011
Hi all,
i have a typical problem of deleting duplicate records from a table. The problem is, the table where delete operation to be done has several reference table. As result it shows me a error integrity constraint <key_name> violated - child record found.The code I am using has been given below.

DELETE FROM order_shell_line
WHERE ROWID NOT IN
(SELECT MIN(ROWID) FROM order_shell_line oshl GROUP BY oshl.oshh_uid,oshl.itm_uid);

Here the oshl.oshh_uid,oshl.itm_uid comination needs to be unique. where oshl.oshh_uid is foreign key of parent table.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 24 2011
Added on Feb 23 2011
16 comments
460 views