Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Help, delete dulications
shu_at_openix.com wrote:
>
> This is the second time I post this message, I guess I didn't
> make my question clear in the first time. Anyway, here is my
> question:
>
> My application will join a Customer table with a Contact Table
> and then create a new table. Since the there are multiple
> entries(rows) in the Contact table can exist for the same
> customer, the new table will be duplicated on some fields from
> Customer table but the entire row still remain unique.
>
> What do I want is to remove those rows contain duplicated
> fields so that the new table will contains only one row
> for each customer. What is the fastest way to delete such kind
> of duplications? Thank in advance.
You can try to use
delete from table1 where rowid not exist (select min(rowid) from table1 group by pk)
--- Name : Lun Wing San (Certified Oracle Database Administrator) Title : Oracle Database Administrator and System Administrator of QRC Phone : (852)27885841 This posting represents the personal opinions of the author. It is not the official opinion or policy of the author's employer. Warranty expired when you opened this article and I will not be responsible for its contents or use.Received on Sun Mar 16 1997 - 00:00:00 CST