X-Original-To: pgsql-sql@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 7A5D94767B7 for ; Thu, 15 May 2003 17:53:34 -0400 (EDT) Received: from postgresql.org ([64.49.215.8]) by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with ESMTP id 21944-02 for ; Thu, 15 May 2003 17:53:02 -0400 (EDT) Received: from anchor-post-35.mail.demon.net (anchor-post-35.mail.demon.net [194.217.242.85]) by postgresql.org (Postfix) with ESMTP id A39AD4767A3 for ; Thu, 15 May 2003 17:27:24 -0400 (EDT) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-35.mail.demon.net with esmtp (Exim 3.36 #2) id 19GQG5-0003op-0Z; Thu, 15 May 2003 22:27:25 +0100 Received: from localhost (localhost.localdomain [127.0.0.1]) by mainbox.archonet.com (Postfix) with ESMTP id 44A9B170A9; Thu, 15 May 2003 22:27:24 +0100 (BST) Received: from client.archonet.com (client.archonet.com [192.168.1.16]) by mainbox.archonet.com (Postfix) with ESMTP id AAEBD170A8; Thu, 15 May 2003 22:27:23 +0100 (BST) Content-Type: text/plain; charset="iso-8859-1" From: Richard Huxton Organization: Archonet Ltd To: "Cyber Join" , pgsql-sql@postgresql.org Subject: Re: select 3 characters Date: Thu, 15 May 2003 22:27:23 +0100 User-Agent: KMail/1.4.3 References: <20030515200526.31852.qmail@linuxmail.org> In-Reply-To: <20030515200526.31852.qmail@linuxmail.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200305152227.23542.dev@archonet.com> X-Virus-Scanned: by AMaViS snapshot-20020531 X-Virus-Scanned: by amavisd-new X-Archive-Number: 200305/339 X-Sequence-Number: 13504 On Thursday 15 May 2003 9:05 pm, Cyber Join wrote: > Hi I need select the first 3 characters from a table > > I try this but doesn't work > > "SELECT left(data,3) AS value FROM table;" > > i see the left function doesn't work what is the similar function in > postgresql It's called "substr": richardh=3D# select substr('abcde',3); substr -------- cde (1 row) richardh=3D# select substr('abcde',1,3); substr -------- abc (1 row) --=20 Richard Huxton