字段类型改用number,不要有非数字的内容.
解决方案 »
- oracle11g r2透明网关链接sql server2005报错
- sql查询问题,查询出数据很快,显示出所有数据时总是以100条递加显示。。
- SQL 中的加法
- IMP-00020: 用于列缓冲区大小 (10) 的长整数列过大???????????????????
- [求助]使用OCI结果执行效率比PROC慢了几倍~
- 大家帮我看看怎么就是连接不上oracle数据库??
- 初学Oracle,有几个问题想在这儿问各位大虾。
- 在线等待!凡回答者都有分!!!
- 请教:ORACLE里有没有像MS SQL里的标识类型(急用,在线等待)
- 字符集的问题
- 已经打开了企业管理器,为什么还说我没连接到OMS?
- Oracle 开发版提问建议
select busid from t_a where substr(busid,1,1)>'9' or substr(busid,1,1)<'0' order by busid
select busid from t_a where substr(busid,1,1)>='0' and substr(busid,1,1)<='9' order by to_number(busid);
select decode(substr(no1,1,4),'9999','k'||substr(no1,5),no1) as no from
(
select decode(substr(no,1,1),'k','9999'||substr(no,2),no) no1 from testa order by to_number(no1)
);
SQL> select no from testa;NO
---
111
101
102
103
104
105
107
108
109
110
11
12
13
14
15
16
1
2
3
4NO
---
k5
k7
k8
k924 rows selectedSQL>
SQL> select decode(substr(no1,1,4),'9999','k'||substr(no1,5),no1) as no from
2 (
3 select decode(substr(no,1,1),'k','9999'||substr(no,2),no) no1 from testa order by to_number(no1) asc
4 );NO
---
1
2
3
4
11
12
13
14
15
16
101
102
103
104
105
107
108
109
110
111NO
---
k5
k7
k8
k924 rows selected
where trim(translate(id,'1234567890',' ')) is null
order by idd
select to_number((replace(cusidt,'k',''))) as bb from tr01 order by bb
select busid from a order by to_number((replace(cusid,'k','')))
oracle是允许这样做的哦
------------ ------------ ------------ ------------ --------------
yeqiufeng 1 3 作家 000000001
秋枫软件 2 4 000000002
秋枫苦雪 100 1 程序员 000000100
叶秋枫 200 2 厨师 000000200
天玄软件 系统填写 5 软件公司 0系统填写
ddy 系统填写 6 manager 0系统填写这是我的测试结果 还行吧
select * from a order by length(id),id好了,揭帖了!