Re: [GENERAL] Delete Duplicates with Using - Mailing list pgsql-general

From Igal @ Lucee.org
Subject Re: [GENERAL] Delete Duplicates with Using
Date
Msg-id 93fad16b-6490-6257-ec04-d43e49ff6025@lucee.org
Whole thread Raw
In response to Re: [GENERAL] Delete Duplicates with Using  (legrand legrand <legrand_legrand@hotmail.com>)
List 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


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

pgsql-general by date:

Previous
From: Melvin Davidson
Date:
Subject: Re: [GENERAL] Non-overlapping updates blocking each other
Next
From: "Igal @ Lucee.org"
Date:
Subject: [GENERAL] Adding identity column to a non-empty table