比如数据库中有个字段叫 姓名,如何按照 26个字母的顺序排序?

解决方案 »

  1.   

    能用一条 sql 语句实现吗?
      

  2.   

    直接order by 姓名就可以吧是字母顺序还是拼音顺序?
      

  3.   

    select * from 表 order by 列 COLLATE Chinese_PRC_CS_AS_KS_WS
    试试
      

  4.   

    declare @t table(姓名 varchar(10))
    insert into @t select '宋'
    insert into @t select '阿'
    insert into @t select '不'
    insert into @t select '没'
    insert into @t select '年'
    insert into @t select '日'select * from @t order by 姓名 collate Chinese_PRC_CI_AS
    --原来是按拼音
      

  5.   

    是汉字的首字母。
    比如 张三,李四,王五等,查询的结果是:
    李(l)四,王五(w),张三(z)...
      

  6.   

    declare @t table(col nvarchar(2))
    insert @t select N'中'
    union all select N'国'
    union all select N'便'
    select * from @t order by col collate Chinese_PRC_CS_AS_KS_WS
    /*
    col  
    ---- 
    便


    */
    多音字怎么办??
      

  7.   

    declare @t table(姓名 varchar(10))
    insert into @t select '王'
    insert into @t select '张'
    insert into @t select '李'select * from @t order by 姓名 collate Chinese_PRC_CI_AS