ITeye博客

关于to_number和to_char函数

bepatient · 2011-02-06 20:24 · 数据库 · 数据库 · Markdown

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 数字 

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

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。