Re: How to remove duplicate lines but save one of the lines?

Поиск
Список
Период
Сортировка
От A B
Тема Re: How to remove duplicate lines but save one of the lines?
Дата
Msg-id dbbf25900807210851v23d6915fgdea194e7abc71746@mail.gmail.com
обсуждение исходный текст
Ответ на Re: How to remove duplicate lines but save one of the lines?  (Said Ramirez <sramirez@vonage.com>)
Ответы Re: How to remove duplicate lines but save one of the lines?  (Said Ramirez <sramirez@vonage.com>)
Re: How to remove duplicate lines but save one of the lines?  ("Scott Marlowe" <scott.marlowe@gmail.com>)
Re: How to remove duplicate lines but save one of the lines?  ("Hoover, Jeffrey" <jhoover@jcvi.org>)
Список pgsql-general
> There is probably a more elegant way of doing it, but  a simple way of doing
> it ( depending on the size of the table ) could be:
>
> begin;
>
> insert into foo select distinct * from orig_table;
> delete from orig_table;
> insert into orig_table select * from foo;
>
> commit;

Just to make it clear to me
Here foo is a table that I have to create  with the command
CREATE TABLE foo (....same columns as orig_table);
?

Is it possible to add a unique constraint to the table, with a
"delete" option so it will delete duplicates?

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

Предыдущее
От: "Francisco Reyes"
Дата:
Сообщение: Re: How to remove duplicate lines but save one of the lines?
Следующее
От: Ludwig Kniprath
Дата:
Сообщение: Re: Field size