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 / jas

delete from table_name where rowid > (select min(rowid)
from table_name where a.col_name=b.col_name)

create new_table as select distinct * from table_name;
drop table_name;
create table_name as select * from new_table;
drop new_table;

delete from table_name where rowid not in (select max
(rowid) from table_name where a.col_name=b.col_name)

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which is faster subquery or join?

656


What is difference between pl and sql?

528


What are different types of triggers?

553


What is primary key secondary key alternate key candidate key?

540


What is sorting in sql?

501






explain the difference between myisam static and myisam dynamic. : Sql dba

513


How do you select unique values in sql?

494


What is the difference between a query and a report?

514


What is count * in sql?

551


Is sqlexception checked or unchecked?

535


Determine if oracle date is on a weekend?

552


what are the advantages of sql ? : Sql dba

541


How does a trigger work?

533


How do I run a program in pl sql?

497


Can you sum a count in sql?

559