From: Stephan Szabo <sszabo@megazone.bigpanda.com>
To: Kent Anderson <kenta@ezyield.com>
Cc: Pgsql-Sql@Postgresql. Org <pgsql-sql@postgresql.org>
Subject: Re: Finding duplicated values
Date: Thu, 21 Oct 2004 13:09:50 -0700 (PDT)
Message-ID: <20041021130815.Y66555@megazone.bigpanda.com> (raw)
In-Reply-To: <LPENJIOOLAIJBFKIBDKOIEAHFPAD.kenta@ezyield.com>
References: <LPENJIOOLAIJBFKIBDKOIEAHFPAD.kenta@ezyield.com>
On Thu, 21 Oct 2004, Kent Anderson wrote:
> I have a few tables that have duplicated values from an import from a
> different database. I have two keys I tried to set as primary and got an
> error
> ERROR: could not create unique index
> DETAIL: Table contains duplicated values.
>
> Is there some join I can use to compare the hmhmkey, wmwmkey pairs against
> the table to find duplicate values? Each pair key should be unique but the
> old database was less than normalized.
Maybe
SELECT hmhmkey, wmwmkey
FROM exceptions
GROUP BY hmhmkey, wmwmkey
HAVING count(*)>1;
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: sszabo@megazone.bigpanda.com, kenta@ezyield.com
Subject: Re: Finding duplicated values
In-Reply-To: <20041021130815.Y66555@megazone.bigpanda.com>
* 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