Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id E60929FB200 for ; Mon, 25 Jun 2007 12:19:58 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 87878-04 for ; Mon, 25 Jun 2007 12:19:50 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from pyxis.powervt.com.ar (host3.powervt.com.ar [200.43.63.66]) by postgresql.org (Postfix) with ESMTP id C66D29FB204 for ; Mon, 25 Jun 2007 12:19:49 -0300 (ADT) Received: from pcfhevia ([201.216.249.98]) by pyxis.powervt.com.ar (IPGroup Mail Server) with ESMTP id 1OT48953; Mon, 25 Jun 2007 12:19:48 -0300 From: "Fernando Hevia" To: "'manchicken'" , Subject: Re: simple SQL question Date: Mon, 25 Jun 2007 12:19:49 -0300 Organization: IP-TEL Message-ID: <04c701c7b73c$46595990$8f01010a@iptel.com.ar> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <200706251005.30120.manchicken@notsosoft.net> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028 Thread-Index: Ace3OxspdgCiBnL3SEuNDEAW7daBHAAAINuQ X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200706/194 X-Sequence-Number: 28684 > > 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;