Re: remote duplicate rows - Mailing list pgsql-general

From ljb
Subject Re: remote duplicate rows
Date
Msg-id eea86m$ojo$1@news.hub.org
Whole thread Raw
Responses Re: remote duplicate rows  (Ron Johnson <ron.l.johnson@cox.net>)
List 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 by date:

Previous
From: Steve Crawford
Date:
Subject: Re: Kill specific connection
Next
From: "J S B"
Date:
Subject: Re: berkley sockets