Received: from morgane.oleane.net (Morgane.OLEANE.Net [194.2.1.9]) by hub.org (8.9.3/8.9.1) with ESMTP id IAA67190 for ; Wed, 28 Apr 1999 08:55:27 -0400 (EDT) (envelope-from nuch@valigene.com) Received: from tom.oleane.net (tom.oleane.net [194.2.28.14]) by morgane.oleane.net with ESMTP id OAA19510 for ; Wed, 28 Apr 1999 14:55:16 +0200 Received: from valigene.com ([62.161.254.162]) by tom.oleane.net (8.8.8/8.8.8) with ESMTP id OAA29041 for ; Wed, 28 Apr 1999 14:55:14 +0200 Sender: nuch@tom.oleane.net Message-ID: <3726F8D8.85E9B69A@valigene.com> Date: Wed, 28 Apr 1999 14:02:32 +0200 From: Nuchanard Chiannilkulchai Organization: ValiGene X-Mailer: Mozilla 4.07 [en] (X11; I; Linux 2.0.36 i686) MIME-Version: 1.0 To: pgsql-sql@hub.org Subject: Re: [SQL] substring References: <8408.925223803@sss.pgh.pa.us> Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Tom Lane wrote: > Nuchanard Chiannilkulchai 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