oracle的TO_NUMBER函数
时间:2021-07-01 10:21:17
帮助过:2人阅读
to_number(
‘123.45‘)
from dual;
TO_NUMBER(
‘123.45‘)
-------------------
123.45
SQL>
select to_number(
‘123.45‘,
‘9999.99‘)
from dual;
TO_NUMBER(
‘123.45‘,
‘9999.99‘)
-----------------------------
123.45
SQL>
select to_number(
‘12‘,
‘99‘)
from dual;
TO_NUMBER(
‘12‘,
‘99‘)
--------------------
12
SELECT TO_NUMBER(
‘$12,123.23‘,
‘$999,999.99‘)
FROM DUAL;
SQL>
SQL>
SQL>
SQL>
Do calculation after the conversion
SQL> select to_number(‘123.45‘) + 2 from dual;
TO_NUMBER(‘123.45‘)+2
---------------------
125.45
SQL> SELECT TO_NUMBER(‘-$12,345.67‘, ‘$99,999.99‘) FROM dual;
TO_NUMBER(‘-$12,345.67‘,‘$99,999.99‘)
-------------------------------------
-12345.67
SQL>
oracle的TO_NUMBER函数
标签: