How to Delete Duplicate Records ?
How to Delete Duplicate Records ?
We have a table called "Employees" , Delete the duplicate records from Column "First_Name" .
-
- Posts: 1
- Joined: Tue Apr 20, 2021 1:56 pm
Delete Duplicate Records
Delete from table_name
Where rowid not in
(select min(rowid)
from table_name
group by column_name);
Where rowid not in
(select min(rowid)
from table_name
group by column_name);
Last edited by Manickaraja on Tue Apr 20, 2021 2:10 pm, edited 1 time in total.
-
- Posts: 1
- Joined: Fri Apr 23, 2021 7:07 am
Re: How to Delete Duplicate Records ?
DELETE FROM Employees
WHERE rowid not in (SELECT MAX(rowid) FROM Employees GROUP BY First_name);
WHERE rowid not in (SELECT MAX(rowid) FROM Employees GROUP BY First_name);
Last edited by Rajesh Jeganathan on Fri Apr 23, 2021 7:43 am, edited 3 times in total.
Re: How to Delete Duplicate Records ?
DELETE FROM table_name
WHERE employee_id NOT IN
(
SELECT MIN(employee_id) FROM table_name
GROUP BY first_name
);
WHERE employee_id NOT IN
(
SELECT MIN(employee_id) FROM table_name
GROUP BY first_name
);