Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Re: Duplicated records

Поиск
Список
Период
Сортировка
От PFC
Тема Re: Duplicated records
Дата
Msg-id op.srattqosth1vuj@localhost
обсуждение исходный текст
Ответ на Duplicated records  (lucas@presserv.org)
Список 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 по дате отправления: