有谁知道用较小数字以较大的数,然后保留小数点后两位,做成百分比的形式?

解决方案 »

  1.   

    select ltrim(cast(N*100.00/M as numeric(12,2)))+'%'
      

  2.   

    LTRIM(CONVERT(DEC(18,2),1.00*100/2))+'%'
      

  3.   

    select ltrim(cast(a*100.0/b as dec(18,2)))+%--a是较小数,b是较大数
      

  4.   

    ltrim(cast(xx*100.0/xx as dec(9,2)))+'%'
      

  5.   

    select ltrim(cast(1.0/3*100 as decimal(18,2)))+'%'                                          
    ----------------------------------------- 
    33.33%(所影响的行数为 1 行)