delete duplicate record
sushovanFeb 23 2011 — edited Feb 24 2011Hi 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.