PostgreSQL/String Functions/to number
Версия от 13:45, 26 мая 2010; (обсуждение)
Содержание
to_number("00123456789", "00999999999")
postgres=# SELECT to_number("00123456789", "00999999999") AS leading_zeroes;
leading_zeroes
----------------
123456789
(1 row)
postgres=#
to_number("123,456,789.00", "999G999G999D99")
postgres=# SELECT to_number("123,456,789.00", "999G999G999D99") AS formatted;
formatted
--------------
123456789.00
(1 row)
postgres=#
to_number("123456789", "999999999")
postgres=# SELECT to_number("123456789", "999999999") AS just_digits;
just_digits
-------------
123456789
(1 row)
postgres=#
to_number("$2,900.00", "L9G999D99")
postgres=# SELECT to_number("$2,900.00", "L9G999D99")
postgres-# AS monetary;
monetary
----------
2900.00
(1 row)
postgres=#