Re: Duplicate records

Поиск
Список
Период
Сортировка
От Mezei Zoltán
Тема Re: Duplicate records
Дата
Msg-id 45C34290.2090300@telefor.hu
обсуждение исходный текст
Ответ на Duplicate records  ("Ezequias Rodrigues da Rocha" <ezequias.rocha@gmail.com>)
Список pgsql-sql
Ezequias Rodrigues da Rocha wrote:
> Hi list,
>
> I am making some data minning and would like to know if someone tell 
> me how to retrieve the duplicate records based in one or two fields of 
> my table.
>
> Any help would be welcomed.
You can use a simple query like this one:

select t1.id, t2.id
from table t1, table t2
where t1.record1 = t2.record1     and t1.record2 = t2.record2     and t1.id != t2.id

This one lists the ids of the matching records. You may need to fine 
tune it to your needs, e.g. use distinct or replace the != with <.

Zizi


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

Предыдущее
От: "Bart Degryse"
Дата:
Сообщение: Re: Duplicate records
Следующее
От: "Ezequias Rodrigues da Rocha"
Дата:
Сообщение: Re: Duplicate records