Re: using Replace funcion in postgresql

From: Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>
To: karinos57 <karinos57(at)hotmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: using Replace funcion in postgresql
Date: 2013-09-17 01:22:50
Message-ID: 5237AEEA.2050808@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 09/16/2013 04: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
>

SELECT
Volume, REPLACE(Volume::text,'.','')::int
FROM MyTable

--
Adrian Klaver
adrian(dot)klaver(at)gmail(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ken Tanzer 2013-09-17 01:36:40 Re: Why does this array query fail?
Previous Message karinos57 2013-09-17 01:20:22 Re: using Replace funcion in postgresql