作者sonesnsdsosi (FOREVERSONE)
看板Database
标题Re: [SQL ] 请问使用to_number字串转数字的错误
时间Tue Feb 10 17:27:03 2015
可以试试这个语法唷~
select substr(atable,instr(atable,'0',-1)+1,10)
from (
select substr(atable,121,7) atable from table A
);
ˊ
※ 引述《erho (ptt访客)》之铭言:
: 资料库名称:oracle
: 资料库版本:9i
: 内容/问题描述:
: table A有一个column为 atable varchar(190)
: 输入 select substr(atable,121,7) from table A;
: 的结果为
: 0001236
: 0000782
: 0000107
: 0000227
: 0001489
: 我使用想让输出的结果为
: 1236
: 782
: 107
: 227
: 1489
: 使用TO_NUMBER函式都回应ORA-01722: invalid number
: select to_number('substr(atable,121,7)') from table A
: 请教各位大大这个语法的问题在那里,望赐教
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 124.199.97.84
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/Database/M.1423560426.A.6C5.html