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 do you tell what your machine name is and what is its IP address?

1590


ur a sql devoloper...what is the process in ur company for finding the database BUGS .. seperate DB testers are there? or devr.s are manage? if DB TESTERS in there what is the process

1845


IS it possible to built the oracle database without setting the kernal parameters?

1850


What is a table index in oracle?

735


How to pass parameters to procedures in oracle?

668






What is the string concatenation operator in oracle?

654


What is translate in oracle?

709


what is meant by magic query

1857


Explain the truncate in oracle?

629


A table t is there.If you perform insert ,update and delete then the trigger will fire.What is the minimum no of trigger required for a table.

4573


Differentiate between translate and replace?

717


Which dictionary view(s) would you first look at to understand or get a high-level idea of a given Advanced Replication environment?

1547


Tab A A B ------ 1 A 2 B 3 C Tab B A B ----- 4 D 5 E 6 F Generate the value into B table from A table. Only table A has the value. Write the SQL query to get B table value.

1348


What are the types of trigger in oracle?

652


How to calculate date and time differences in oracle?

626