Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Remove duplicates
nick <nick-love_at_juno.com> wrote in message
news:tar1hjh7b7tcaf_at_corp.supernews.com...
>
> xiaomh wrote:
> > I want to import 10000 entries to my database. There are some
> > duplicates in them. What's the best way to remove them(duplicates)?
> select distinct column_name from table;
Sorry, missed the original post.
I think, you may consider loading the data to table, and
then add a unique constraint with EXCEPTIONS INTO clause.
Example from SQL reference:
ALTER TABLE census
ADD CONSTRAINT unq_city_state UNIQUE (city, state)
USING INDEX PCTFREE 5 TABLESPACE user_y
EXCEPTIONS INTO bad_keys_in_ship_cont;
The EXCEPTIONS INTO clause causes Oracle to write information to the bad_keys_in_ship_cont table about any rows currently in the census table that violate the constraint.
Best regards, Alexey
.. A conclusion is simply the place where someone got tired of thinking
Received on Tue Mar 13 2001 - 23:37:57 CST