Re: What does count(*) count?

Поиск
Список
Период
Сортировка
От Karsten Hilbert
Тема Re: What does count(*) count?
Дата
Msg-id 20031231174630.F941@hermes.hilbert.loc
обсуждение исходный текст
Ответ на Re: What does count(*) count?  (Együd Csaba <csegyud@vnet.hu>)
Список pgsql-general
> In the database table the records have duplicated and I've two rows for
> every primary key - with different OIDs.
> Is there any safe method to get rid of only one of each duplicated row?

select distinct on (oid) * from your_table into working_table

check working_table

truncate your_table

select from working_table into your_table
--
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Bug and/or feature? Complex data types in tables...
Следующее
От: Tom Lane
Дата:
Сообщение: Re: What does count(*) count?