Re: [Pdx-pm] duplicate records

From: Selena Deckelmann <selena(at)stereojoy(dot)com>
To: Thomas J Keller <kellert(at)ohsu(dot)edu>
Cc: pdx-pm-list-owner(at)pm(dot)org, pdxpug(at)postgresql(dot)org
Subject: Re: [Pdx-pm] duplicate records
Date: 2006-10-19 03:44:10
Message-ID: D23A706D-FE86-4046-9F48-64DC8ABB2307@stereojoy.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pdxpug

On Oct 18, 2006, at 6:17 PM, Thomas J Keller wrote:

> passwords=# INSERT INTO foobar (SELECT DISTINCT username,
> password,object,url_address,description,status FROM password);
> ERROR: column "password_id" is of type integer but expression is of
> type character varying

something like this may work:

db=# create table newtable as (SELECT DISTINCT on (username)
username, password, object, url_address,description, status from
password);
db=# delete from password where 1>0;
db=# insert into password (username, password, object,
url_address,description, status) SELECT * from newtable;

-selena

In response to

Browse pdxpug by date

  From Date Subject
Next Message Mark Wong 2006-10-19 22:21:30 authentication services
Previous Message Devin Ben-Hur 2006-10-18 23:49:17 Re: duplicate records