Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: find duplicates
"s Lehaire" <s.lehaire_at_meilleuregestion.com> wrote in message news:<b00t5c$mvq$1_at_reader1.imaginet.fr>...
> Hi I have to create a primary key on a table but I've got a duplicate data
> in this table
> so i try to find a sql request to find the duplicat rows
> can you help me ?
Look in the SQL manual as the constraint clause for adding a PK has an option to record the rowid of duplicate rows into a exceptions table.
Otherwise build a non=unique index on the key columns and join the table to itself on the keys where the rowid's are not equal. This will produce all rows with multiple records for the same key.
HTH -- Mark D Powell -- Received on Tue Jan 14 2003 - 08:33:05 CST