pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kent Anderson <kenta@ezyield.com>
To: Pgsql-Sql@Postgresql. Org <pgsql-sql@postgresql.org>
Subject: Finding duplicated values
Date: Thu, 21 Oct 2004 14:58:52 -0400
Message-ID: <LPENJIOOLAIJBFKIBDKOIEAHFPAD.kenta@ezyield.com> (raw)

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.

I was trying to use the code below but it returned no rows.

SELECT hmhmkey, wmwmkey
FROM   exceptions
EXCEPT
SELECT hmhmkey, wmwmkey
FROM  exceptions;

Any suggestions?

Kent Anderson
EZYield.com
407-629-0900
www.ezyield.com

========================================
This electronic message transmission contains information from the Company
that may be proprietary, confidential and/or privileged. The information is
intended only for the use of the individual(s) or entity named above.  If
you are not the intended recipient, be aware that any disclosure, copying or
distribution or use of the contents of this information is prohibited.  If
you have received this electronic transmission in error, please notify the
sender immediately by replying to the address listed in the "From:" field.

view thread (5+ messages)  latest in thread

Message-ID: <LPENJIOOLAIJBFKIBDKOIEAHFPAD.kenta@ezyield.com>
Permalink:  ../LPENJIOOLAIJBFKIBDKOIEAHFPAD.kenta@ezyield.com/
Also on:    postgresql.org/message-id/LPENJIOOLAIJBFKIBDKOIEAHFPAD.kenta@ezyield.com

 · 

reply

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: kenta@ezyield.com
  Subject: Re: Finding duplicated values
  In-Reply-To: <LPENJIOOLAIJBFKIBDKOIEAHFPAD.kenta@ezyield.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