jueves, febrero 21, 2008

Oracle - Delete duplicate rows

Si en una tabla que se te olvidó poner una restricción Unique y tienes algunos registros repetidos puedes borrar los registros repetidos por medio de una sentencia como:

DELETE FROM CLIENTES WHERE rowid NOT IN (SELECT max(rowid) FROM CLIENTES GROUP BY NOMBRE);

Para una explicación más amplia Delete duplicate rows from Oracle

1 comentarios:

Home Theater dijo...

Hello. This post is likeable, and your blog is very interesting, congratulations :-). I will add in my blogroll =). If possible gives a last there on my blog, it is about the Home Theater, I hope you enjoy. The address is http://home-theater-brasil.blogspot.com. A hug.