Re: problem with distinct not distincting...

Поиск
Список
Период
Сортировка
От Susan Cassidy
Тема Re: problem with distinct not distincting...
Дата
Msg-id 3A51F387FE0CC74D80FA60C146987F250259A6EFB7F3@oc-exchange1.stbernard.com
обсуждение исходный текст
Ответ на Re: problem with distinct not distincting...  (Susan Cassidy <scassidy@edgewave.com>)
Список pgsql-general
I see you have the length included.

Perhaps, UTF8 characters in one and ascii in the other?

Susan

-----Original Message-----
From: pgsql-general-owner@postgresql.org [mailto:pgsql-general-owner@postgresql.org] On Behalf Of Susan Cassidy
Sent: Wednesday, October 17, 2012 8:27 AM
To: John Beynon; pgsql-general@postgresql.org
Subject: Re: [GENERAL] problem with distinct not distincting...

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

Susan

-----Original Message-----
From: pgsql-general-owner@postgresql.org [mailto:pgsql-general-owner@postgresql.org] On Behalf Of John Beynon
Sent: Wednesday, October 17, 2012 3:48 AM
To: pgsql-general@postgresql.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@postgresql.org) To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general




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




В списке pgsql-general по дате отправления:

Предыдущее
От: Guillaume Lelarge
Дата:
Сообщение: pg_stats in 9.2
Следующее
От: Tom Lane
Дата:
Сообщение: Re: pg_stats in 9.2