或 order by convert(int,字段) or: order by convert(numeric(10,2),字段)
严格点order by cast(case when isnumeric(rtrim(ltrim(编号)))=1 then 编号 else 0 end as int)ororder by cast(case when isnumeric(rtrim(ltrim(编号)))=1 then 编号 else 0 end as numeric(10,2))
在排序后加 len(ltrim(rtrim(排序字段A ))) 即 order by len(ltrim(rtrim(排序字段A))),排序字段A
order by convert(int,字段)
or:
order by convert(numeric(10,2),字段)
即 order by len(ltrim(rtrim(排序字段A))),排序字段A
这样排序执行效率会提高很多。