oracle中,在字符串轉成數字時,如果字段中存在不能轉成功的內容,將會報ora-01722錯誤,解決方法如下:
select ziduan from table;
1
2
3
4a
5
select case when REGEXP_INSTR(ziduan,'[^[:digit:]]{1,}',1)=0 then to_number(ziduan) end ziduan_new from table;
1
2
3
null
5
oracle中,在字符串轉成數字時,如果字段中存在不能轉成功的內容,將會報ora-01722錯誤,解決方法如下:
select ziduan from table;
1
2
3
4a
5
select case when REGEXP_INSTR(ziduan,'[^[:digit:]]{1,}',1)=0 then to_number(ziduan) end ziduan_new from table;
1
2
3
null
5
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。