Re: Delete Duplicates with Using

From: "Igal (at) Lucee(dot)org" <igal(at)lucee(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Delete Duplicates with Using
Date: 2017-10-15 19:28:36
Message-ID: 93fad16b-6490-6257-ec04-d43e49ff6025@lucee.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 10/14/2017 12:32 AM, legrand legrand wrote:
> DELETE FROM table_with_duplicates AS T1 USING table_with_duplicates AS T2
> WHERE
> T1.column_1 = T2.column_1
> AND T1.column_2 = T2.column_2
> AND T1.column_3 = T2.column_3
> AND T1.row_num < T2.row_num

Thank you, I actually thought about that at first but it seemed "too
easy" and I was looking for some solution with JOIN.

Anyway, this seems to work great.

Thanks,

Igal

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Igal @ Lucee.org 2017-10-15 23:01:40 Adding identity column to a non-empty table
Previous Message Melvin Davidson 2017-10-15 14:59:25 Re: Non-overlapping updates blocking each other