日期:2014-05-16  浏览次数:20462 次

关于to_number和to_char函数

to_number是将字符串按照指定的格式专为数字,相反,to_char是将数字转换为指定格式的字符串。

select to_char(1/7,'999,990.99') from dual;--正常

select to_number('19.43453','99999999.99') from dual;--报错,无效字符
select to_number('0.43453','99999990.99') from dual;--报错,无效字符
select to_number('19.43453','99999999.99999999') from dual;--正常

select round(1/7,4) from dual;

?oracle order by number/char 数字?

?如果是字符串则不会按顺序