pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard Huxton <dev@archonet.com>
To: Shavonne Marietta Wijesinghe <shavonne.marietta@studioform.it>
Cc: pgsql-sql@postgresql.org
Subject: Re: SELECT DISTINCT
Date: Tue, 19 Feb 2008 13:51:10 +0000
Message-ID: <47BADECE.7050603@archonet.com> (raw)
In-Reply-To: <00c001c872de$5a7dd000$3102a8c0@dream>
References: <00c001c872de$5a7dd000$3102a8c0@dream>

Shavonne Marietta Wijesinghe wrote:
> Hello
> 
> I have 2 records with the same value. Even when i do a select with
> DISTINCT, it returns me both the records instead of one.
> 
> SELECT DISTINCT ON (TE_COGNOME) TE_COGNOME, TE_NOME, N_GEN_TEST,
> TE_SESSO, TE_ATTNASC, TE_LUONASC, TE_INDI, TE_DTNASC, TE_PROVSTATO,
> TE_PROV, TE_PATERNITA, TE_RICHIESTA FROM MOD48_02 WHERE TE_COGNOME
> LIKE 'WIJ%' AND TRIM(DELETED) IS NULL ORDER BY TE_COGNOME, N_GEN_TEST
> DESC;

Can you provide:
1. The output of your query (just the duplicate rows will be fine)
2. The output of "\d MOD48_02"?
3. The output of:
    SELECT xmin,xmax, ':' || TE_COGNOME || ':' FROM MOD48_02
    WHERE TE_COGNOME = ???
    For the duplicate value of course

-- 
   Richard Huxton
   Archonet Ltd



view thread (7+ messages)

Message-ID: <47BADECE.7050603@archonet.com>
Permalink:  ../47BADECE.7050603@archonet.com/
Also on:    postgresql.org/message-id/47BADECE.7050603@archonet.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: dev@archonet.com, shavonne.marietta@studioform.it
  Subject: Re: SELECT DISTINCT
  In-Reply-To: <47BADECE.7050603@archonet.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