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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Help needed with Duplicates/Unique values

Re: Help needed with Duplicates/Unique values

From: Jerry Gitomer <jgitomer_at_p3.net>
Date: 1998/02/27
Message-ID: <34F79662.2AF1@p3.net>#1/1

Hi Ken,

As is always the case when using Oracle there is more than one way of solving a problem. The one I would try first if I were you is one I saved when I saw it

"Try creating the primary key with the EXCEPTIONS INTO option and use the
rowids stored in this table to fish out the duplicates. Look in the SQL manual on how to do this and create the EXCEPTIONS table and its format. You can create the primary key disabled and then enable it into EXCEPTIONS.
Works fine, done it a few times. Faster than using HAVING COUNT > 1.

HTH Cheers"
Nuno Souto
nsouto_at_acay.com.au

I haven't tried it myself, but it looks good. Of course before you do it copy off the existing table. Fastest way I found is:

        CREATE new_table AS SELECT * FROM old_table;

Regards

Jerry

umpaul18_at_cc.umanitoba.ca wrote:
>
> G'day!
>
> I was re-working an old table, and I decided to try to find a unique key on
> it, I found 2 columns that were likely so I did a check to see if they were
> unique , and I found a ton of duplicates. Turns out that for each 'key'
> there were a number of values in a column.
>
> So, I want to put that column in it's own table (otherwise there is a SICK
> amount of duplicated data), before I do this, I need to make sure that
> without this column, everything is fine (no duplicates, my 'key' is a
> unique key).
>
> What is an easy way to do this?
>
> Stay Casual,
>
> Ken
>
> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/ Now offering spam-free web-based newsreading
 

-- 
Jerry Gitomer		Since I know how to spell DBA I became one. 
jgitomer_at_p3.net
Received on Fri Feb 27 1998 - 00:00:00 CST

Original text of this message

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