Search Postgresql Archives

Re: Finding (and deleting) dupes in relation table

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Nevermind, figured it out:

select distinct on (table1id, table2id) * into temp
from table3;
delete from table3;
insert into table3 select * from temp;



--- CSN <cool_screen_name90001@xxxxxxxxx> wrote:

> I have a table that relates id's of two other
> tables:
> 
> table1id, table2id
> 
> Dupes have found their way into it (create unique
> index across both fields fails). Is there a quick
> and
> easy way to find and delete the dupes (there are
> tens
> of thousands of records)?
> 
> Thanks,
> CSN
> 
> 
> 		
> __________________________________ 
> Yahoo! Mail - PC Magazine Editors' Choice 2005 
> http://mail.yahoo.com
> 



		
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faq

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux