Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: how can I delete duplicate rows?
A copy of this was sent to "Mike Moore" <hicamel_at_mail.home.com> (if that email address didn't require changing) On Wed, 23 May 2001 01:22:00 GMT, you wrote:
>How can I delete duplicate rows from a table and only leave
>one in the table? Lets assume that all of the columns have
>identical values.
>
>Thanks,
>Mike
>
delete from t t1
where rowid <> ( select min(rowid)
from t t2 where t2.c1 = t1.c1 and t2.c2 = t1.c2 and .... )
-- Thomas Kyte (tkyte_at_us.oracle.com) Oracle Service Industries Howtos and such: http://asktom.oracle.com/ Oracle Magazine: http://www.oracle.com/oramag Opinions are mine and do not necessarily reflect those of Oracle CorpReceived on Wed May 23 2001 - 08:36:22 CDT