rt

解决方案 »

  1.   

    不是这样写 有个规则  一开始安装sql得时候有提示使用什么方法排序
      

  2.   

    我是用Java嵌sql的,要让select出来的数据按ASCII排序
    select语句应该怎样写?
      

  3.   

    select * from a order by ascii(a)这么写?
      

  4.   

    select a from table1 order by ASCII(a) asc--如a列的字符为1位时
      

  5.   

    select char(78)--如果是数字
    select ASCII('N')--如果是字符declare @ta table (id int)
    insert @ta select 78 union select 101
    select * from @ta order by char(id) asc(2 行受影响)
    id
    -----------
    101
    78(2 行受影响)
      

  6.   

    select a from table1 where col1='06' order by ASCII(usercode) asc;
    好像不行啊
      

  7.   


    declare @ta table (id int)
    insert @ta select 78 union select 101
    select char(id) from @ta order by char(id) asc
    --以下为转换后的字符
    (2 行受影响)----
    e
    N(2 行受影响)
      

  8.   

    select char(id) from @ta order by char(id) asc
    这个行了
      

  9.   

    用char(id)就行了,ASCII(a)就不行,?
    //因为a开头字母都是英文字符,所有没有影响
      

  10.   

    substring(字段,1,1)--取字段中的其中一个字符作为条件
    right(字段,len(字段)-1)--排除第一个字符
      

  11.   

    order by ascii(字段)这样是可以得   试了下
      

  12.   

    用char(id)就解决了,是想要得到的结果,就是order by ascii(字段)报编译错误
    不知道为什么
    找不到*LIBL类型*N中的ASCII
      

  13.   

    char()应该是区acsii对应得字符串 不能理解这个排序怎么可以而另外方法却不可以捏
      

  14.   

    select * from 表 order by ascii(left(字段,1)) desc