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