Re: using Replace funcion in postgresql

From: David Johnston <polobo(at)yahoo(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: using Replace funcion in postgresql
Date: 2013-09-17 05:00:42
Message-ID: 1379394042360-5771184.post@n5.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

Solution provided elsewhere but make sure you cover the corner-case where
there are zeros in the decimal positions. Depending on the how the number
column is defined those may be lost whereas I presume you want "00" to
appear at the end for integer amounts and "90" to appear to round-tenths.

David J.

--
View this message in context: http://postgresql.1045698.n5.nabble.com/using-Replace-funcion-in-postgresql-tp5771164p5771184.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Juan Daniel Santana Rodés 2013-09-17 05:26:26 ¿Cómo comparar el resultado de dos consultas?
Previous Message David Johnston 2013-09-17 04:38:35 Re: Why does this array query fail?