how to delete duplicate rows from a specified table(only
single table)
how do you know which join is need to be used

Answer Posted / mkumar.it

delete <table_name> where rowid not in (select min(rowid)
from <table_name> group by <dup_rec_col>)

max(rowid) can also be used provided you have to retain the
latest value other wise min(rowid) is fine.

Is This Answer Correct ?    8 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what are different types of keys in sql?

607


Can we perform dml on view?

556


What is clustered index sql?

506


How do I run pl sql in sql developer?

630


Does oracle use sql?

516






Which command is used to delete a trigger?

777


How do I write a sql query in pgadmin 4?

558


Are there any features that are decommissioned in 11g that are not present in 11g?

1593


Which constraints we can use while creating database in sql?

617


What is the difference between subquery and correlated query?

530


How to display the records between two range in Oracle SQL Plus?

641


Is sql open source?

545


Can pl sql procedure have a return statement?

552


What is the purpose of a secondary key?

511


What is string data type in sql?

535