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

How to create a testing table in oracle?

542


What is Segment Advisor in Oracle?

666


How can windows applications connect to oracle servers?

518


What is a connect identifier?

536


How to login to the server without an instance?

616






How do you increase the OS limitation for open files (LINUX and/or Solaris)?

1462


What is a sub query? Describe its types?

540


Explain a synonym?

600


Can we convert a date to char in oracle and if so, what would be the syntax?

547


How to check the server version in oracle?

608


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

538


What is partitioned table in Oracle?

628


What is the difference between hot backup and cold backup in oracle? Tell about their benefits also.

541


What is the difference between translate and replace?

552


How to estimate disk space needed for an export job?

558