Removing duplicate entries

Поиск
Список
Период
Сортировка
От Scott Ford
Тема Removing duplicate entries
Дата
Msg-id CAA10533F41BB7448F7659D4D0671907347C6A@cx41.800onemail.com
обсуждение исходный текст
Ответы Re: Removing duplicate entries  (Jaime Casanova <systemguards@gmail.com>)
Re: Removing duplicate entries  (Michael Fuhr <mike@fuhr.org>)
Список pgsql-novice
Hi all -

I have two tables - customers and documents.  Each customer can be
related to several different documents.  There has been a bug in some
software that's been duplicating the addition of a certain type of
document for the customers.  Even though each customer can have
documents of the same type, in this case I don't want it.

customers
    customer_id
    ...

documents
    customer_id
    document_id
    document_type_id
    ...

So, for example, there are two documents with the same document_type_id
associated with one customer.

Can someone help me with a SQL statement that might help me remove the
duplicate documents for a certain document_type_id?

Thanks,
Scott.

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

Предыдущее
От: "Luis Silva"
Дата:
Сообщение: Re: convert bool result query
Следующее
От: Jaime Casanova
Дата:
Сообщение: Re: Removing duplicate entries