Home > Database > Mysql Tutorial > body text

Oracle排序报错“ORA-01722: 无效数字”处理

WBOY
Release: 2016-06-07 17:05:07
Original
1917 people have browsed it

Oracle排序报错ldquo;ORA-01722: 无效数字rdquo;处理

问题:

某表名tab,内有一个字符型字型需数值大小排序,,但直接采用to_number、cast等手段均报ORA-01722: 无效数字

解决:

select   t.xzjg   from   tab  t

order by  to_number(translate(t.xzjg, '0123456789.' || t.xzjg, '0123456789.')) asc nulls last

--按数值大小排序,同时把空值排到最后

linux

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!