Re: [SQL] substring - Mailing list pgsql-sql

From Nuchanard Chiannilkulchai
Subject Re: [SQL] substring
Date
Msg-id 3726F8D8.85E9B69A@valigene.com
Whole thread Raw
In response to Re: [SQL] substring  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-sql
Tom Lane wrote:

> Nuchanard Chiannilkulchai <nuch@valigene.com> writes:
> > The problem is : select  position ('_' in a ) from table_a  does not
> > work.
> >  ERROR:  No such function 'strpos' with the specified attributes
>
> Hmm, I don't see that under either 6.4.2 or current sources.
>
> What data type is your column a?  I tried text and char(n) and neither
> one gave an error...
>
>                         regards, tom lane
   the datatype of a is char(8).
   select a, substring(a from 1 for position('_' in a) - 1) as part from
test;   This solution from José works great, THANX.
   Nuch





pgsql-sql by date:

Previous
From: Christophe Labouisse
Date:
Subject: Re: [SQL] Strange behavior
Next
From: Herouth Maoz
Date:
Subject: Re: [SQL] OUTER JOINS