Delete duplicate records from oracle table
Note: please before executing this query take data backup.
Example I:
Delete from employees
where rowid in
(select rowid
from
(select first_name, last_name, rowid,
row_number() over
(partition by first_name, last_name order by employee_id)
stf_row
from employees)
where stf_row > 1);
Example II :
Delete FROM
Employees A
WHERE
a.rowid >
ANY (
SELECT
B.rowid
FROM
Employees B
WHERE
A.First_name = B.First_Name
AND
A.last_name = B.Last_Name
);
Example III :
Delete from
Employees A
Where rowid <> (
SELECT
Max(rowid)
From
Employees B
Where
B.First_Name = A.First_Name
AND