------解决方案-------------------- 试试 select * from 表名 order by 字段名+0 ------解决方案--------------------
order by 的时候 replace "-",这样不就可以了 ------解决方案--------------------
1 with a as(select '西直门北大街58号7号楼1001' col1 from dual
2 union all
3 select '西直门北大街58号7号楼102' from dual
4 union all
5 select '西直门北大街59号8号楼10-1002' from dual
6 union all
7 select '西直门北大街59号8号楼1-103' from dual
8 )
9 select col1 from a
10* order by to_number(substr(replace(col1,'-',''),instr(col1,'楼')-length(repl
ace(col1,'-',''))))
SQL> /
------解决方案-------------------- with a as(select '西直门北大街8号7号楼1001' col1 from dual
union all
select '西直门北大街58号7号楼102' from dual
union all
select '西直门北大街59号8号楼10-1002' from dual
union all
select '西直门北大街59号18号楼1-103' from dual
)