From: Tarlika Elisabeth Schmitz <postgresql@numerixtechnology.de>
To: pgsql-sql@postgresql.org
Subject: Re: identifying duplicates in table with redundancies
Date: Mon, 27 Sep 2010 17:54:18 +0100
Message-ID: <20100927175418.162ee906@dick.coachhouse> (raw)
In-Reply-To: <065CBEA1-1647-4233-BBB6-48E879FD91B0@gmail.com>
References: <20100923223940.5019475e@dick.coachhouse>
<8590CAE9E5504E23AB08C4EF31EA066F@marktestcr.marktest.pt>
<20100924171226.6000b310@dick.coachhouse>
<065CBEA1-1647-4233-BBB6-48E879FD91B0@gmail.com>
On Fri, 24 Sep 2010 18:12:18 +0100
Oliver d'Azevedo Christina <oliveiros.cristina@gmail.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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: postgresql@numerixtechnology.de
Subject: Re: identifying duplicates in table with redundancies
In-Reply-To: <20100927175418.162ee906@dick.coachhouse>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox