X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id F38129FA4DE for ; Fri, 5 May 2006 18:55:15 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 19129-09 for ; Fri, 5 May 2006 18:55:05 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from b.mail.sonic.net (b.mail.sonic.net [64.142.19.5]) by postgresql.org (Postfix) with ESMTP id 7B4B29FA3A3 for ; Fri, 5 May 2006 18:55:05 -0300 (ADT) Received: from localhost.localdomain (64-142-36-103.dsl.static.sonic.net [64.142.36.103]) by b.mail.sonic.net (8.13.6/8.13.3) with ESMTP id k45Lt3ee017513 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO); Fri, 5 May 2006 14:55:03 -0700 Received: from elein by localhost.localdomain with local (Exim 4.50) id 1Fc8DF-0005Ej-Mk; Fri, 05 May 2006 14:51:49 -0700 Date: Fri, 5 May 2006 14:51:49 -0700 To: "Kashmira Patel (kupatel)" Cc: pgsql-sql@postgresql.org Subject: Re: Returning String as Integer Message-ID: <20060505215149.GC18214@varlena.com> Mail-Followup-To: "Kashmira Patel (kupatel)" , pgsql-sql@postgresql.org References: <18AE59788A3FC640A367E5652E664D8002093F0C@xmb-sjc-237.amer.cisco.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <18AE59788A3FC640A367E5652E664D8002093F0C@xmb-sjc-237.amer.cisco.com> User-Agent: Mutt/1.5.9i From: elein X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200605/60 X-Sequence-Number: 25091 Use the to_number() function to convert text to numbers. In the manual under functions and operators. The other function like it is to_date(). --elein elein@varlena.com On Fri, May 05, 2006 at 02:37:13PM -0700, Kashmira Patel (kupatel) wrote: > Hi all, > I have a table with a column of type 'text'. It mainly contains numbers. Is > there any way to select a value from this column and return it as an integer? > > Thanks, > Kashmira