Re: delete non-unique

Поиск
Список
Период
Сортировка
От Phillip Smith
Тема Re: delete non-unique
Дата
Msg-id 1177509473.4706.15.camel@fukawi2.homelinux.net
обсуждение исходный текст
Ответ на delete non-unique  (henlin <henlin@yandex.ru>)
Список pgsql-novice
Similar to other suggestion:

BEGIN;
SELECT DISTINCT ON (col1) * INTO TEMP unique_rows FROM table1;
COPY unique_rows TO '/tmp/unique.sql';
TRUNCATE TABLE table1;
COPY table1 FROM '/tmp/unique.sql';
COMMIT;

On Wed, 2007-04-25 at 13:08 +0400, henlin wrote:
i need to clean up some tables: from several equal rows keep only one  
(like `sort -u`)

aaa bbb - do not delete
aaa bbb - delete
aaa bbb - delete

*******************Confidentiality and Privilege Notice*******************

The material contained in this message is privileged and confidential to the addressee. If you are not the addressee indicated in this message or responsible for delivery of the message to such person, you may not copy or deliver this message to anyone, and you should destroy it and kindly notify the sender by reply email.

Information in this message that does not relate to the official business of Weatherbeeta must be treated as neither given nor endorsed by Weatherbeeta. Weatherbeeta, its employees, contractors or associates shall not be liable for direct, indirect or consequential loss arising from transmission of this message or any attachments

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

Предыдущее
От: Frank Bax
Дата:
Сообщение: Re: Comparison of dates
Следующее
От: Francois Deliege
Дата:
Сообщение: moving data from windows to linux