plsql eliminate duplicate rows?

enrique_aeo
enrique_aeo used Ask the Experts™
on
Hi experts, I have a table with 3 columns: c1, c2, c3
 I have repeated rows, as I can do to eliminate duplicate rows?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2012
Distinguished Expert 2018
Commented:
delete from table t1 where row_id>(select min(rowid) from table t2 where t1.c1=t2.c1 and t1.c2=t2.c2 and t1.c3=t2.c3);

A few other ways:
http://www.dba-oracle.com/t_delete_duplicate_table_rows.htm
Data Engineer
Commented:
try this.

DELETE FROM Table1 a
 WHERE EXISTS (SELECT 1
                 FROM Table1 b
                WHERE a.c1 = b.c1
                      AND a.c2 = b.c2
                      AND a.c3 = b.c3
                      AND b.ROWID < a.ROWID)

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial