Re: [GENERAL] problem with distinct not distincting...

2012-10-17 Thread Chris Angelico
On Thu, Oct 18, 2012 at 2:32 AM, John Beynon wrote: > I just managed to solve the problem infact. > > The trailing 'e' character on the name was different for one row. All > my tools, (pgadmin and the source data in openoffice) showed the same > 'e' character but psql showed it as different charac

Re: [GENERAL] problem with distinct not distincting...

2012-10-17 Thread John Beynon
ctober 17, 2012 6: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 o

Re: [GENERAL] problem with distinct not distincting...

2012-10-17 Thread Merlin Moncure
On Wed, Oct 17, 2012 at 5:48 AM, John Beynon wrote: > 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

Re: [GENERAL] problem with distinct not distincting...

2012-10-17 Thread David Johnston
> -Original Message- > From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general- > ow...@postgresql.org] On Behalf Of John Beynon > Sent: Wednesday, October 17, 2012 6:48 AM > To: pgsql-general@postgresql.org > Subject: [GENERAL] problem with distinct not distinctin

Re: [GENERAL] problem with distinct not distincting...

2012-10-17 Thread Tom Lane
John Beynon writes: > 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 |

Re: [GENERAL] problem with distinct not distincting...

2012-10-17 Thread Susan Cassidy
; 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-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Beha

Re: [GENERAL] problem with distinct not distincting...

2012-10-17 Thread Susan Cassidy
bject: [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 nam

[GENERAL] problem with distinct not distincting...

2012-10-17 Thread John Beynon
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 U