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
--按数值大小排序,同时把空值排到最后
Statement: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