Re: problem with distinct not distincting...

From: Susan Cassidy <scassidy(at)edgewave(dot)com>
To: John Beynon <john(at)kyan(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: problem with distinct not distincting...
Date: 2012-10-17 15:27:12
Message-ID: 3A51F387FE0CC74D80FA60C146987F250259A6EFB7EE@oc-exchange1.stbernard.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Are you sure that one of those entries doesn't have a trailing space?

Susan

-----Original Message-----
From: pgsql-general-owner(at)postgresql(dot)org [mailto:pgsql-general-owner(at)postgresql(dot)org] On Behalf Of John Beynon
Sent: Wednesday, October 17, 2012 3:48 AM
To: pgsql-general(at)postgresql(dot)org
Subject: [GENERAL] problem with distinct not distincting...

I have a pretty basic query;

select distinct on (name) name, length(name) from drugs where customer_id IS NOT NULL order by name;

which I'd expect to only return me a single drug name if there are duplicates, yet I get

name | length
==========
Roaccutane | 10
Roaccutane | 10

table encoding is UTF8...

I'm scratching my head!

Thanks,

John.

--
Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org) To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message John Beynon 2012-10-17 15:32:00 Re: problem with distinct not distincting...
Previous Message Will Rutherdale (rutherw) 2012-10-17 15:25:27 Re: Does Postgres Object-Relational Syntax follow Standard?