pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Christoph Haller <ch@rodos.fzk.de>
To: Kent Anderson <kenta@ezyield.com>
To: pgsql-sql@postgresql.org
Subject: Re: Finding duplicated values
Date: Fri, 22 Oct 2004 09:49:28 +0200
Message-ID: <4178BB88.D7175ADC@rodos.fzk.de> (raw)
References: <LPENJIOOLAIJBFKIBDKOIEAHFPAD.kenta@ezyield.com>

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.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

You might want to search the [SQL] archive on the following topics
for more inspiration:

selecting duplicate records
Delete 1 Record of 2 Duplicate Records

Regards, Christoph





view thread (5+ messages)

Message-ID: <4178BB88.D7175ADC@rodos.fzk.de>
Permalink:  ../4178BB88.D7175ADC@rodos.fzk.de/
Also on:    postgresql.org/message-id/4178BB88.D7175ADC@rodos.fzk.de

 · 

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: ch@rodos.fzk.de, kenta@ezyield.com
  Subject: Re: Finding duplicated values
  In-Reply-To: <4178BB88.D7175ADC@rodos.fzk.de>

* 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