Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id CDC929FB4ED for ; Mon, 25 Jun 2007 12:10:59 -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 43779-03 for ; Mon, 25 Jun 2007 12:10:54 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from raptor.webhostserver.biz (raptor.webhostserver.biz [208.101.26.91]) by postgresql.org (Postfix) with ESMTP id A17039FB5DD for ; Mon, 25 Jun 2007 12:10:54 -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 1I2qDK-0001Ym-6P for pgsql-sql@postgresql.org; Mon, 25 Jun 2007 09:10:51 -0600 From: manchicken Organization: notsosoft.net To: pgsql-sql@postgresql.org Subject: Re: simple SQL question Date: Mon, 25 Jun 2007 10:05:29 -0500 User-Agent: KMail/1.9.7 References: <467FD14F.7000302@joshuaneil.com> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200706251005.30120.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/193 X-Sequence-Number: 28683 On Monday 25 June 2007 09:38:39 Milen A. Radev wrote: > Joshua =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0: > > 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? > > Use "to_char(int, text)", details here - > http://www.postgresql.org/docs/current/static/functions-formatting.html Don't use to_char unless you actually want character data though. Just try this... SELECT (column/100) FROM table; =2D-=20 ~ 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