Re: identifying duplicates in table with redundancies

From: Tarlika Elisabeth Schmitz <postgresql(at)numerixtechnology(dot)de>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: identifying duplicates in table with redundancies
Date: 2010-09-27 16:54:18
Message-ID: 20100927175418.162ee906@dick.coachhouse
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Fri, 24 Sep 2010 18:12:18 +0100
Oliver d'Azevedo Christina <oliveiros(dot)cristina(at)gmail(dot)com> wrote:

>>> SELECT DISTINCT trainer_id,trainer_name
>>> FROM (
>>> SELECT trainer_name -- The field you want to test for duplicates
>>> FROM (
>>> SELECT DISTINCT "trainer_id","trainer_name"
>>> FROM student
>>> ) x
>>> GROUP BY "trainer_name" -- the field you want to test for
>>> duplicates
>>> HAVING (COUNT(*) > 1)
>>> ) z
>>> NATURAL JOIN student y

What indices would you recommend for this operation?

--

Best Regards,
Tarlika Elisabeth Schmitz

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Eduardas Kazakas 2010-09-28 08:34:30 Regexp matching
Previous Message Vibhor Kumar 2010-09-27 11:31:18 Re: pgdump with insert command help