Re: Delete duplicates

Поиск
Список
Период
Сортировка
От Dani Oderbolz
Тема Re: Delete duplicates
Дата
Msg-id 3EF95A63.6070609@ecologic.de
обсуждение исходный текст
Ответ на Re: Delete duplicates  ("Denis Arh" <denis@exonium.net>)
Список pgsql-sql
Denis Arh wrote:

>How to delete "real" duplicates?
>
>id | somthing
>-----------------------
>1 | aaa
>1 | aaa
>2 | bbb
>2 | bbb
>
>(an accident with backup recovery...)
>
In these cases, its certainly the best to rebuild your table
using a

CREATE TABLE new AS
SELECT col1,col1..
FROM old
GROUPY BY col1,col2...

If you have got many duplicates, recreating a new table
semms better to me than deleteing.
(Another advantage is that you still have the "bad" table as a record).

Cheers,
Dani






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

Предыдущее
От: "Frankie Lam"
Дата:
Сообщение: Re: database & table size
Следующее
От: Dani Oderbolz
Дата:
Сообщение: Re: TR: Like and =