现有表A50 
891
896
90 
如何按 位排列?50 
90 
891
896

解决方案 »

  1.   

    select id from TB order by id asc
      

  2.   


    create table test_123(a int)
    insert into test_123
    select 50
    union
    select 90
    union 
    select 891
    union 
    select 896select * from test_123
    order by LEN(a),a
      

  3.   

    数字就直接 order by 字段 asc
    如果字符的话就用2楼方式.
    二楼的方式很好
      

  4.   

    数字的话,安位排序就是按大小的升序排列啊。
    数字的话
    ORDER BY A
    字符的话
    ORDER BY CAST(A AS INT)
      

  5.   


    select id from TB order by id asc++
      

  6.   

    select id from TB order by id asc
      

  7.   


    select id from A order by id asc