Re: select distinct error ? - Mailing list pgsql-general

From Jean-Luc Lachance
Subject Re: select distinct error ?
Date
Msg-id 3D408C70.C26F3D4D@nsd.ca
Whole thread Raw
In response to select distinct error ?  ("Henrik Steffen" <steffen@city-map.de>)
List 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@sime.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

pgsql-general by date:

Previous
From: Doug McNaught
Date:
Subject: Re: regression test
Next
From: "Varsha Agarwal"
Date:
Subject: List tables in the database