order by 时候,根据字符集来排序怎么写来着??

解决方案 »

  1.   

    指这样??declare @a table
    (
    a varchar(10)
    )insert into @a
    select '甲' union all
    select '丁' union all
    select '乙' union all
    select '丙'select * from @aselect * from @a order by charindex(a,'甲 乙 丙 丁')/*a          
    ---------- 




    a          
    ---------- 




    */
      

  2.   

    楼上的例子真不错,学习了。
    表变量和列同名,要是不同名就更好了:
    declare @t table (a varchar(10))
      

  3.   

    什么字符集? 排序规则吧?order by 列 collate 排序规则名
      

  4.   

    按姓氏笔画排序:
    Select * From TableName Order By CustomerName Collate Chinese_PRC_Stroke_ci_as不知道对不对呢
      

  5.   

    LouisXIV(夜游神) 的例子,给我很大启发..
    谢谢