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

Please explain drop constraint oracle?

623


What is integrity and what is constraint??Explain with example

1692


What is a cursor and what are the steps need to be taken?

597


What is a trace file and how is it created in oracle?

548


Please explain compound trigger in oracle?

594






What is memory advisor in Oracle?

627


What view(s) do you use to associate a users SQLPLUS session with his o/s process?

1898


How can I create database in oracle?

559


Give the advantages and disadvantages of clusters.

570


can u send the sql dumps to sivakumarr1987@gmail.com plz help me

2588


Whats the benefit of dbms_stats over analyze?

1489


What is ceil and floor in oracle?

568


How do I call oracle stored procedures that take no parameters?

560


How to use values from other tables in update statements using oracle?

562


WHEN CURSOR MOVES FROM ONE FORM TO ANOTHER FORM, HOW MANY TRIGGER WILL BE FIRED AND WHAT ARE THEIR SEQUENCE?

1798