Search Postgresql Archives

Re: SQL for Deleting all duplicate entries

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

 



On 9/5/07, Scott Marlowe <scott.marlowe@xxxxxxxxx> wrote:
> begin;
> delete from table where uid in (select * from table t1 join table t2
> on (t1.field1=t2.field1 AND t1.field2=t2.field2 AND
> t1.field3=t2.field3 AND t1.uid>t2.uid) );
> (check for dups / lost data)
> commit;


There's a bug up there ^^^

should be:

delete from table where uid in (select t1.uid from...

---------------------------(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