Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id B74A49FBB0D for ; Mon, 25 Jun 2007 14:15:00 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 87189-05 for ; Mon, 25 Jun 2007 14:14:51 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from raptor.webhostserver.biz (raptor.webhostserver.biz [208.101.26.91]) by postgresql.org (Postfix) with ESMTP id 37BE19FBB04 for ; Mon, 25 Jun 2007 14:14:52 -0300 (ADT) Received: from 74-134-94-223.dhcp.insightbb.com ([74.134.94.223] helo=[192.168.2.104]) by raptor.webhostserver.biz with esmtp (Exim 4.66) (envelope-from ) id 1I2s9L-0008Q3-2L for pgsql-sql@postgresql.org; Mon, 25 Jun 2007 11:14:51 -0600 From: manchicken Organization: notsosoft.net To: pgsql-sql@postgresql.org Subject: Re: simple SQL question Date: Mon, 25 Jun 2007 12:09:27 -0500 User-Agent: KMail/1.9.7 References: <04c701c7b73c$46595990$8f01010a@iptel.com.ar> In-Reply-To: <04c701c7b73c$46595990$8f01010a@iptel.com.ar> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200706251209.27320.manchicken@notsosoft.net> X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - raptor.webhostserver.biz X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [0 0] / [47 12] X-AntiAbuse: Sender Address Domain - notsosoft.net X-Source: X-Source-Args: X-Source-Dir: X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200706/198 X-Sequence-Number: 28688 On Monday 25 June 2007 10:19:49 Fernando Hevia wrote: > > > I have a column with the following values (example below) > > > > > > 5673 > > > 4731 > > > 4462 > > > 5422 > > > 756 > > > 3060 > > > > > > I want the column to display the numbers as follows: > > > > > > 56.73 > > > 47.31 > > > 44.62 > > > 54.22 > > > 7.56 > > > 30.60 > > > > > > I have been playing around with string functions but cannot seem to > > > figure out a quick solution. Does anyone have any suggestions? > > > > Don't use to_char unless you actually want character data though. > > > > Just try this... > > > > SELECT (column/100) FROM table; > > Cast the column in order to get the decimal part: > > SELECT (column::real/100) FROM table; > > > > > ---------------------------(end of broadcast)--------------------------- > TIP 6: explain analyze is your friend Good point. Thanks for the catch :) -- ~ manchicken <>< (A)bort, (R)etry, (I)nfluence with large hammer. 09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0 Please avoid sending me Word or PowerPoint attachments. See http://www.gnu.org/philosophy/no-word-attachments.html