Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: How to find DUPLICATE KEYS FOUND

Re: How to find DUPLICATE KEYS FOUND

From: Rachel Carmichael <carmichr_at_hotmail.com>
Date: Tue, 20 Feb 2001 10:04:12 -0800
Message-ID: <F001.002B8DBE.20010220095636@fatcity.com>

"borrowed" from Ari Kaplan of this list:

delete from &table_name a where rowid > (select min(rowid) from &&table_name b
where a.&column_name=b.&&column_name)
/

this will prompt you for the table that has the dups and the column that has them

you can modify it to add columns, since your index is a concatenated one

>From: Larry Taylor <ltaylor_at_iq.com>
>Reply-To: ORACLE-L_at_fatcity.com
>To: Multiple recipients of list ORACLE-L <ORACLE-L_at_fatcity.com>
>Subject: How to find DUPLICATE KEYS FOUND
>Date: Tue, 20 Feb 2001 08:56:33 -0800
>
>Hi all,
>
>How can I find duplicate keys and drop the duplicate? My database is 8.1.6
>and I tried the following
>and got this error:
>
>CREATE UNIQUE INDEX I_SA_C_OWNERID_C_NAME ON P_ANSWER (P_ID , P_NAME )
>PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE(INITIAL 65536) LOGGING
>TABLESPACE
>USERS;
>
>ORA-01452: cannot CREATE UNIQUE INDEX; duplicate keys found
>
>Thanks in advance.
>
>Larry
>--
>Please see the official ORACLE-L FAQ: http://www.orafaq.com
>--
>Author: Larry Taylor
> INET: ltaylor_at_iq.com
>
>Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
>San Diego, California -- Public Internet access / Mailing Lists
>--------------------------------------------------------------------
>To REMOVE yourself from this mailing list, send an E-Mail message
>to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
>the message BODY, include a line containing: UNSUB ORACLE-L
>(or the name of mailing list you want to be removed from). You may
>also send the HELP command for other information (like subscribing).



Get your FREE download of MSN Explorer at http://explorer.msn.com
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Rachel Carmichael
  INET: carmichr_at_hotmail.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Tue Feb 20 2001 - 12:04:12 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US