如下数据串9358.0000~123.3478~9876.0123~。想要使返回的数据串为9358.00~123.35~9876.01该使用哪个函数进行截取?请高手赐教。
解决方案 »
- 一个Oracle数据文件的问题
- 请教:数据库链路的问题?
- Oracle基于表创建新表
- 用外连接实现该语句怎么写?
- 高手急救:安装Oracle Data Provider For .net出错。
- 存储过程更新表!
- dblink导数据的问题
- oracle数据库中得共享模式和专有模式是什么意思啊?有何区别啊?能详细得介绍一下吗?
- oracle不能启动.用alter database open命令后提示:system01.dbf有错误,请用媒体恢复,如何解决?
- 重装WINDOWS200后ORACLE的处理办法
- 请教一个小数位截取的存储过程。
- 紧急求助!!!PL/SQL Developer中的NVarchar显示不正确?
四舍五入
||'~'|| trim(to_char(round(to_number(regexp_substr('9358.0000~123.3478~9876.0123~','[^~]+',1,2)),2),999999.99))
||'~'|| trim(to_char(round(to_number(regexp_substr('9358.0000~123.3478~9876.0123~','[^~]+',1,3)),2),999999.99))
from dual
||'~'|| trim(to_char(round(to_number(regexp_substr('9358.0000~123.3478~9876.0123~','[^~]+',1,2)),2),999999.99))
||'~'|| trim(to_char(round(to_number(regexp_substr('9358.0000~123.3478~9876.0123~','[^~]+',1,3)),2),999999.99))
from dual
with t as(
select '~9358.0000~123.3478~9876.0123~' str from dual
)
select
replace(wm_concat(trim(to_char(round(substr(str,
instr(str, '~', 1, rownum) + 1,
instr(str, '~', 1, rownum + 1) -
instr(str, '~', 1, rownum) - 1),
2),
'99999999990.99'))),',','~')
from t
connect by rownum < length(str) - length(replace(str, '~', '')) - 1
9358.00~123.35~9876.01