Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: how can I delete duplicate rows?
Mike Moore 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
There are many solutions. Here's one of them.
CREATE TABLE xyz AS
SELECT distinct field1, field2, field3
FROM mytable;
TRUNCATE TABLE mytable;
INSERT INTO mytable
SELECT *
FROM xyz;
Daniel A. Morgan Received on Wed May 23 2001 - 01:00:31 CDT