SQL里面用order by排序为什么必须01,02这样排?
如果1,2,3....10,11就会出现1,10,11,2,3,4?
如果1,2,3....10,11就会出现1,10,11,2,3,4?
解决方案 »
- 急!100分寻求帮助,关于数据表里记录合并的问题
- for xml auto的问题?
- 一个关于存储过程异常处理的小问题
- 视图与表更新冲突问题
- dbo
- 学习sql server要不要掌握数据原理的知识?
- 有关用ldf文件恢复数据库数据的问题~~
- 英雄帖:"跪求,我宁愿用我的全部家当来觖决这个问题,谁能帮我把这个数据修好呀?"
- 在线等待给分,如何用EC把informix数据库中的一张表的记录取出,放到文本文件中,
- 关于使用distinct后排序的问题
- 怎样才能把数据库里面的关系图也备份出来,还原的时候一起还原到别的数据库中?
- select count(*) as spn from plan2 a inner join product b on ... 的问题? 现在怎么计算它有多少条呢?
declare @t table (t varchar(2))
insert into @t
select '1' union all
select '11' union all
select '12' union all
select '3' union all
select '4' select * from @t
order by cast (t as int )
除非你转换成数字支持YiZhiNet(我姓义很多人都觉得奇怪)的
order by cast(字段 as int)
declare @t table(a varchar(20))
insert into @t select 'abcdef1'
union all select 'abcdef2'
union all select 'abcdef10'
union all select 'abcdef90'
union all select 'abcdef1040'select * from @t order by cast(substring(a,patindex('%[0-9]%',a),len(a)) as int)