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

Answer Posted / aseem k

Tried and tested:
Table d:
7
8
7

DELETE FROM D WHERE ROWID IN (
SELECT DISTINCT MIN(ROWID) FROM D
WHERE DEPTNO IN
(SELECT DEPTNO FROM D GROUP BY DEPTNO
HAVING COUNT(DEPTNO)>1))

Is This Answer Correct ?    1 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

15. Display the item_cost and then truncate it to the nearest hundred, ten, unit, tenth and hundredth.

1701


What are the extensions used by oracle reports?

573


What is object data modeling?

507


What are the restrictions on external table columns?

552


What is oracle server autotrace in oracle?

614






Explain the use of tables option in exp command.

592


How to change system global area (sga) in oracle?

572


How do I limit the number of rows returned by an oracle query after ordering?

636


What are joins, explain all types of joins?

1724


What is using clause and give example?

587


How can Oracle users be audited?

610


How to run queries on external tables?

568


In what script is snap$ created? In what script is the scott/tiger schema created?

2245


What is a private synonym?

1086


How can you use check constraints for self referential integrity?

523