Re: remove everything before the period

Поиск
Список
Период
Сортировка
От Giuseppe Broccolo
Тема Re: remove everything before the period
Дата
Msg-id 52387646.3080703@2ndquadrant.it
обсуждение исходный текст
Ответ на remove everything before the period  (karinos57 <karinos57@hotmail.com>)
Ответы Re: remove everything before the period  (Agustin Larreinegabe <alarreine@gmail.com>)
Список pgsql-general
Il 17/09/2013 04:21, karinos57 ha scritto:
> Hi,
> I am trying to remove everything before the period in other words i only
> want to show the values that starts from the period.  For instance
> 897.78 ==> 78
> 74.25 ==> 25
> 3657.256 ==> 256
>
> well the code below only shows everything before the period but i want to
> show everything after the period
>
> select volume, substring(volume from 1 for position('.' in volume) - 1) as
> column
> from MyTable    ;
Try with: " SELECT volume, substring(volume from position('.' in volume)
+ 1) AS column FROM MyTable; "

Giuseppe.

--
Giuseppe Broccolo - 2ndQuadrant Italy
PostgreSQL Training, Services and Support
giuseppe.broccolo@2ndQuadrant.it | www.2ndQuadrant.it



В списке pgsql-general по дате отправления:

Предыдущее
От: Luca Ferrari
Дата:
Сообщение: Re: How to compare the results of two queries?
Следующее
От: Adam C Falkenberg
Дата:
Сообщение: Re: Using ODBC and VBA to pull data from a large object