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

Поиск
Список
Период
Сортировка
От btober@ct.metrocast.net
Тема Re: How to remove duplicate lines but save one of the lines?
Дата
Msg-id 4884C18F.4040203@ct.metrocast.net
обсуждение исходный текст
Ответ на How to remove duplicate lines but save one of the lines?  ("A B" <gentosaker@gmail.com>)
Список pgsql-general
A B wrote:
> I have a table with rows like this
> A 1
> A 1
> B 3
> B 3
> C 44
> C 44
> and so on.
>
> and I want it to be
> A 1
> B 3
> C 44
>
> so how can I remove the all the duplicate lines but one?
>

CREATE TEMP TABLE tmp AS SELECT DISTINCT * FROM t1;
DROP TABLE t1;
CREATE TABLE t1 AS SELECT * FROM tmp;



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

Предыдущее
От: "Scott Marlowe"
Дата:
Сообщение: Re: How to remove duplicate lines but save one of the lines?
Следующее
От: brian
Дата:
Сообщение: Re: Calling Python functions with parameters