Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: How to find DUPLICATE KEYS FOUND
delete from pa_answer
where rowid in (select rowid
from p_answer pa
where rowid > (select min(pa2.rowid)
from p_answer pa2
where pa.p_id = pa2.p_id and pa.p_name = pa2.p_name))
>>> Larry Taylor <ltaylor_at_iq.com> 02/20/01 03:15PM >>> Thanks William it worked, but how to delete it?
-----Original Message-----
Sent: Tuesday, February 20, 2001 9:36 AM
To: Multiple recipients of list ORACLE-L
how about
select rowid,p_id,p_name
from p_answer pa
where rowid > (select min(pa2.rowid)
from p_answer pa2
where pa.p_id = pa2.p_id and pa.p_name = pa2.p_name)
This will display the p_id,p_name and rowid of all the duplicate rows that have the same p_id and p_name.
>>> Larry Taylor <ltaylor_at_iq.com> 02/20/01 11:56AM >>> 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 Liststo: 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).
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: William Beilstein
INET: BeilstWH_at_obg.com
Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Liststo: 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).
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Liststo: 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).
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: William Beilstein
INET: BeilstWH_at_obg.com
Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Liststo: 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 - 16:39:51 CST
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message