SELECT DISTINCT

From: "Shavonne Marietta Wijesinghe" <shavonne(dot)marietta(at)studioform(dot)it>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: SELECT DISTINCT
Date: 2008-02-19 10:01:10
Message-ID: 00c001c872de$5a7dd000$3102a8c0@dream
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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;

What should I do??

Thanks

Shavonne

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Stuart Brooks 2008-02-19 10:54:14 Am I wasting my time with partitions?
Previous Message Michael Fuhr 2008-02-18 04:38:18 Re: comment on COLUMN, broken or misunderstanding?