how to delete all duplicate records from a table using
subquery?

Answer Posted / lingareddy

by using below sub query delete duplicate all records:

DELETE FROM dept WHERE salary IN (
SELECT salary FROM dept GROUP BY salary HAVING ( COUNT(salary) > 1 ))


here is dept is the table name
salary is the column name

for any doubts about SQL contact with me

Thanks & Regards
Lingareddy.S

Is This Answer Correct ?    0 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what happened to the global index when I truncate the data in one of the partition?

1753


How to use fetch statement in a loop?

804


What are data pump export and import modes?

850


What are the differences between char and varchar2 in oracle?

842


Where are the settings stored for each instance in oracle?

923


How to find the duplicate rows count from employees table in oracle?

870


How to select an oracle system id (sid)?

812


How do I connect to oracle?

788


How different is ms access and oracle?

792


How to write a query with a left outer join in oracle?

858


How can you merge two tables in oracle?

777


What is hash cluster in oracle?

853


How to fetch the row which has the max value for a column?

777


What is ceil and floor in oracle?

835


How to manage transaction isolation level?

782