Re: Duplicated records - Mailing list pgsql-sql

From PFC
Subject Re: Duplicated records
Date
Msg-id op.srattqosth1vuj@localhost
Whole thread Raw
In response to Duplicated records  (lucas@presserv.org)
List pgsql-sql
> How can I delete the duplicated records with "DELETE FROM TABLE WHERE..."
> clause??
> The problem is becouse I have imported data from Dbase (dbf) file, and  
> this
> function have not built the Constraint (unique, primary key, ...), and  
> this
> function is usually executed.
If you have no primary key how can you reference a record in order to  
delete it ?I'd say use a temporary table...If you have complete row dupes (ie. the entire row is duplicated) useSELECT
*FROM table GROUP BY *(or select distinct)
 
If only the primary key is duplicated but other fields change, then you  
have to decide which one you wanna keep !


pgsql-sql by date:

Previous
From: lucas@presserv.org
Date:
Subject: Duplicated records
Next
From: "Thomas F. O'Connell"
Date:
Subject: Re: DROP IF ...