declare @t table(a varchar(10))
insert into @t select 'ab'
union all select 'vd'
union all select 'gh'select * from @t order by left(a,1)

解决方案 »

  1.   

    直接order by 就行select * from @t order by a
      

  2.   

    In most of the case, ReViSion(和尚) 's solution is better:1. If you have index on a,  you can not use index on a with "order by left(a,1)", but you can use index with "order by a" , thus "order by a" 2. if you do not have index on a, then "order by left(a,1)" will do left function on every row of a, it may be slower than "order by a".3. however, if the average length of a is very large, see, each row has 1000 characters in column a,  "order by left(a,1)"  may be faster than "order by a" since the string comparsion is faster.Note: 
      "order by a " does not means that "order by left(a,1)"is better than "order by left(a,1)"
     the reason is that