pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Nuchanard Chiannilkulchai <nuch@valigene.com>
To: pgsql-sql@hub.org
Subject: Re: [SQL] substring
Date: Wed, 28 Apr 1999 14:02:32 +0200
Message-ID: <3726F8D8.85E9B69A@valigene.com> (raw)
References: <8408.925223803@sss.pgh.pa.us>

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






view thread (22+ messages)  latest in thread

Message-ID: <3726F8D8.85E9B69A@valigene.com>
Permalink:  ../3726F8D8.85E9B69A@valigene.com/
Also on:    postgresql.org/message-id/3726F8D8.85E9B69A@valigene.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: nuch@valigene.com, pgsql-sql@hub.org
  Subject: Re: [SQL] substring
  In-Reply-To: <3726F8D8.85E9B69A@valigene.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox