Re: select distinct error ?

From: Jean-Luc Lachance <jllachan(at)nsd(dot)ca>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Mario Weilguni <mweilguni(at)sime(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: select distinct error ?
Date: 2002-07-25 23:40:32
Message-ID: 3D408C70.C26F3D4D@nsd.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

How about:

SELECT distinct foo, length(foo) from bar where foobar like 'foobar%'
and foobar ~'^[0-9]*$';

I have a feeling that you may have an O in stead of a zero.

Tom Lane wrote:
>
> "Mario Weilguni" <mweilguni(at)sime(dot)com> writes:
> > try:
> > SELECT distinct foo, length(foo) from bar where foobar like 'foobar%';
> > maybe one has a blank attached?
>
> He said the column was char(6), so they should all be padded to length
> 6. I was wondering about nonprinting characters (carriage returns etc)
> in the data, myself.
>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Varsha Agarwal 2002-07-26 00:10:32 List tables in the database
Previous Message Christopher Weimann 2002-07-25 23:02:33 Re: MySQL vs. PostgreSQL