利用substr函数截取从第四个字符开始的的字符子串转化为数字类型进行排序 我写的测试例子:供参考 create table test_user ( id int, name varchar2(10) ); insert into test_user select '1','hao1' from dual union all select '2','hao111' from dual union all select '3','hao1102' from dual union all select '4','hao113' from dual;select name from test_user order by to_number(substr( name ,4)) 测试结果:1 hao1 2 hao111 3 hao113 4 hao1102
我写的测试例子:供参考 create table test_user
(
id int,
name varchar2(10)
);
insert into test_user
select '1','hao1' from dual
union all
select '2','hao111' from dual
union all
select '3','hao1102' from dual
union all
select '4','hao113' from dual;select name from test_user order by to_number(substr( name ,4))
测试结果:1 hao1
2 hao111
3 hao113
4 hao1102