现在数据库的数据为:
1
1-1
1-2
1-1-1
2
2-1
3
4
5
6
7
8
9
10
11
……需要请上述内容按升序排序成下列结果:
1
1-1
1-1-1
1-2
2
2-1
3
4
5
6
7
8
9
10
11
……
请问有什么好方法?谢谢
1
1-1
1-2
1-1-1
2
2-1
3
4
5
6
7
8
9
10
11
……需要请上述内容按升序排序成下列结果:
1
1-1
1-1-1
1-2
2
2-1
3
4
5
6
7
8
9
10
11
……
请问有什么好方法?谢谢
解决方案 »
- 外键关联主键是否可以是varchar2字段?
- oracle 定时启动存储过程
- Oracle中主键ID自增长
- pl/sql怎样获取具有同一字段的所有表
- 取前10行不用 rownum<=10 怎么取??
- 菜鸟提问:我想恢复orcl数据库,安装完了然后怎么操作?
- 有办法吗,朋友? select
- 如何在 sql plus里面运行一个存储过程?
- 小白求简略说明一下Oracle APEX 怎样进行开发?我想做一个和sample差不多的应用程序
- oracle 11g数据库重启服务和监听后,sqlplus连接不上,plsql也连接不上?
- 一条select 查询速度问题?急!!
- 急救:大数据量的查询和插入如何提高效率???
select a, '0'||a b from xx where lengthb(a)>1 and substrb(a,2,1)>='1' and substrb(a,2,1)<='9' union select a, '0'||a b from xx where lengthb(a)=1 union select a,a b from xx where lengthb(a)>1 and (substrb(a,2,1)<'1' or substrb(a,2,1)>'9') ) order by b只用a列即可。
但只对100以下有效,且-后面的数字也只能到9,呵呵。
select a, a b from xx where lengthb(a)>1 and substrb(a,2,1)>='1' and substrb(a,2,1)<='9' union select a, '0'||a b from xx where lengthb(a)=1 union select a,'0'||a b from xx where lengthb(a)>1 and (substrb(a,2,1)<'1' or substrb(a,2,1)>'9') ) order by b