Re: using Replace funcion in postgresql

From: John R Pierce <pierce(at)hogranch(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: using Replace funcion in postgresql
Date: 2013-09-17 01:09:14
Message-ID: 5237ABBA.5010501@hogranch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 9/16/2013 4:55 PM, karinos57 wrote:
>> SELECT
>> Volume, REPLACE(Volume,'.','')
>> FROM MyTable
>>
> The data in my table looks like this:
>
> 88.97
> 448.58 and etc
>
> i want to show like this with out the period:
>
> 8897
> 44858
>
> I have tried to use different ways but still getting the error i hope
> someone out there can help me. How can i achieve this? thanks

still getting _the_ error? what error is that? can we assume your
table field is a numeric rather than a string value?

you could use to_char(volume*100, 'FM9999999'), or maybe even just
(volume*100)::integer

--
john r pierce 37N 122W
somewhere on the middle of the left coast

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David Johnston 2013-09-17 01:16:01 Re: Why does this array query fail?
Previous Message bricklen 2013-09-17 01:07:06 Re: Why does this array query fail?