Re: simple SQL question

From: Ireneusz Pluta <ipluta(at)wp(dot)pl>
To: Joshua <joshua(at)joshuaneil(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: simple SQL question
Date: 2007-06-25 15:33:29
Message-ID: 467FE049.9040008@wp.pl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Joshua napisał(a):
> 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?

if I read you correctly, I might suggest:

select round(your_column/100.0, 2) as divided_by_100 from your_table;

(note dividing by 100.0 (decimal), not just by 100 (integer))

>
> Please let me know.
>
> Thanks.
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
> http://archives.postgresql.org
>
>
>
>

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Nicholas Barr 2007-06-25 15:41:02 Re: another simple SQL question
Previous Message Joshua 2007-06-25 15:28:40 another simple SQL question