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 is a database schema in oracle?

624


What happens if you set the sga too low in oracle?

555


How do we get field details of a table?

549


How to create a new oracle data file?

559


I creat Credit memo in AR. Now i want revers the Credit Memo.how you can revers that what out any aditional entry.

1856






Explain an exception?

566


How to delete all rows a table in oracle?

623


State some uses of redo log files?

565


Point the difference between translate and replace?

572


What is connection pool in oracle?

558


Explain what are the advantages of views?

613


Explain alias?

714


What are the set operators union, union all, minus & intersect meant to do?

563


What happens if the imported table already exists?

549


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

613