select right('0'+rtrim(字段),2) from 表

解决方案 »

  1.   

    select right('0'+rtrim(a),2) as s from (select 1 as a union select 2 union select 11 union select 12) t/*
    s
    ---- 
    01
    02
    11
    12
    */
      

  2.   

    前置最大可能的0数,然后用right()函数。
      

  3.   

    (树上的鸟儿 没有考虑数据类型问题 libin_ftsafe(子陌红尘) 的是对的
      

  4.   

    若加上转换用这个也可 replace(str(2.35689,5,3),' ','0') 两次
      

  5.   

    sorry 写错了 
    select replace(str(2.35689,6,3),' ','0')
      

  6.   

    --try
    declare a int
    set a=2
    select right(1000000+a,2)
      

  7.   

    declare @i int
    set @i=2
    print right(1000000+@i,2)