Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: DUPLICATE VALUE CHECK
How about:
create table tmp_table as select substr(rowid,length(rowid)-7,7) last_seven from <your_table>;
and then:
select last_seven duplicates from
(
select last_seven,count(*)
from tmp_table
group by last_seven
having count(*) > 1
);
I didn't test it, but it should be pretty fast with "only" 450.000 rows.
HTH, Remco
-----Oorspronkelijk bericht-----
Van: Shirish Khapre [mailto:shirish_at_rolta.com]
Verzonden: dinsdag 26 juni 2001 17:42
Aan: Multiple recipients of list ORACLE-L
Onderwerp: DUPLICATE VALUE CHECK
Hi all
i have one column in my table (in which daily 100000 rows are added to the table) which has values like
XYZ_A_LO0000_0000001 XYZ_A_LO0000_0000002 XYZ_A_LO0000_0000003 XYZ_A_LO0000_0000004 XYZ_A_LO0000_0000005 XYZ_A_LO0000_0000006 XYZ_A_LO0000_0000007 XYZ_A_LO0000_0000008 XYZ_A_LO0000_0000009
i want to check duplicate values.. there are 2 cases of duplication
Case I :- i am using the following query
select from my_table where rowid not in(
select max(rowid) from my_table
group by my_column_name );
i am getting the rows which are duplicate ..
CASE II : - i want to check duplication in last 7 characters(which are actually nos) in my column like
0000001
0000002
0000003....so on....
i am using substr function to get this value and i am checking the values with remaining rows..
but as the table contains nearly 450000(present rowcount) the query is taking lot of time...which i can't afford... the column has index on it.
plz suggest me what to do??
Shirish Khapre, SE Rolta India Ltd.
Off Ph No. (+91) (022) 8326666,8262222,8300568
Ext'n 2730
Minds are like parachutes. They only function when they are open
--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: Shirish Khapre
INET: shirish_at_rolta.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).
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 Jun 26 2001 - 13:19:40 CDT