SQL for Deleting all duplicate entries

Поиск
Список
Период
Сортировка
От Håkan Jacobsson
Тема SQL for Deleting all duplicate entries
Дата
Msg-id 26928758.1502191189002956131.JavaMail.root@ps1.bredband.net
обсуждение исходный текст
Ответы Re: SQL for Deleting all duplicate entries  ("Scott Marlowe" <scott.marlowe@gmail.com>)
Re: SQL for Deleting all duplicate entries  ("Merlin Moncure" <mmoncure@gmail.com>)
Список pgsql-general
Hi,

I want to create a DELETE statement which deletes duplicates
in a table.

That is, I want to remove all rows - but one - having three
columns with the same data (more columns exist and there the
data varies).
For example:
column1
column2
column3
column4
column5

column2 = 'test', column3 = 'hey' and column4 IS NULL for
several rows in the table. I want to keep just one of those
rows.

Is this possible? I can't figure it out, so any help MUCH
appreciated!

/regards, Håkan Jacobsson - System developer at Relevant
Traffic, Sweden

В списке pgsql-general по дате отправления:

Предыдущее
От: Owen Hartnett
Дата:
Сообщение: Re: problem with transactions in VB.NET using npgsql
Следующее
От: "Rodrigo De León"
Дата:
Сообщение: Re: Partition Reindexing