Re: remote duplicate rows

Поиск
Список
Период
Сортировка
От ljb
Тема Re: remote duplicate rows
Дата
Msg-id eea86m$ojo$1@news.hub.org
обсуждение исходный текст
Ответы Re: remote duplicate rows  (Ron Johnson <ron.l.johnson@cox.net>)
Список pgsql-general
junkone1@gmail.com wrote:
> hI
> i have a bad situation that i did not have primary key. so i have a
> table like this
> colname1                colname2
> 1                                 apple
> 1                                 apple
> 2                                  orange
> 2                                   orange
>
> It is a very large table. how do i remove the duplctes quickly annd
> without much change.

Make a new table (with a primary key) and the same columns in order,
and do: INSERT INTO newtable SELECT DISTINCT * FROM oldtable;

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

Предыдущее
От: Steve Crawford
Дата:
Сообщение: Re: Kill specific connection
Следующее
От: "J S B"
Дата:
Сообщение: Re: berkley sockets