sql 将值转换为ascii来排序
--将后面两们字符转换为ascii值来排序 select code, substring(code,1,len(code)-2)+CAST(ascii(substring(code,len(code)-1,1)) AS varchar(5))+CAST(ascii(substring(code,len(wbsNo),1)) AS code(5)) from table1 where left(code,6)='030101' order by substring(code,1,len(code)-2)+CAST(ascii(substring(code,len(code)-1,1)) AS varchar(5))+CAST(ascii(substring(code,len(code),1)) AS varchar(5))