如图表1:
0.1234
0.15673
0.12333
0.14566
.......要求查询后得到的表:
12.34%
15.67%
12.33%
14.57%
.......

解决方案 »

  1.   

    select ltrim(col)+'%' from tb
      

  2.   

    select ltrim(str(a*100,20,2))+'%' from [Table]
      

  3.   

    select col*100+'%' from tableName
      

  4.   

    保留两位小数---测试数据---
    if object_id('[tb]') is not null drop table [tb]
    go
    create table [tb]([col] numeric(6,5))
    insert [tb]
    select 0.1234 union all
    select 0.15673 union all
    select 0.12333 union all
    select 0.14566
     
    ---查询---
    select ltrim(cast(col as dec(18,2)))+'%' as col from [tb]---结果---
    col                                       
    ----------------------------------------- 
    0.12%
    0.16%
    0.12%
    0.15%(所影响的行数为 4 行)
      

  5.   

    汗..再乘100select ltrim(cast(col*100 as dec(18,2)))+'%' as col from [tb]
    /**
    col                                       
    ----------------------------------------- 
    12.34%
    15.67%
    12.33%
    14.57%(所影响的行数为 4 行)
    **/
      

  6.   

    select cl*100+'%' from table