oracle排序问题:一个varchar型字段,有数据1,2,11,c1等,如何排序成1,2,11,c1
答案:2 悬赏:80
解决时间 2021-02-12 18:21
- 提问者网友:陪我到最后
- 2021-02-12 09:59
oracle排序问题:一个varchar型字段,有数据1,2,11,c1等,如何排序成1,2,11,c1
最佳答案
- 二级知识专家网友:爱情是怎么炼成的
- 2021-02-12 11:14
select 字段 from (
select 字段,ascii(字段) b from 表名 where ascii(字段)<=48 or ascii(字段)>=57
union all
select 字段,cast(字段 as int) b from 表名 where ascii(字段)>=48 and ascii(字段)<=57)c
order by b
select 字段,ascii(字段) b from 表名 where ascii(字段)<=48 or ascii(字段)>=57
union all
select 字段,cast(字段 as int) b from 表名 where ascii(字段)>=48 and ascii(字段)<=57)c
order by b
全部回答
- 1楼网友:温柔刺客
- 2021-02-12 11:29
先建立一个和原来有同样字段的表,将数据通过
insert into test
select * from test1
插入新表,然后将数据转移出去,然后清空源表的数据,然后删除clob字段然后增加varchar类型字段
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯