Select 
Rtrim(a)+(Case status When 0 Then N'(已停用)' End) As a From 
test

解决方案 »

  1.   

    Select a+(Case status When 0 Then '(已停用)' End) As a From test
      

  2.   

    create table test(a int,b int,status int)
    insert into test 
    select 1,1,0 union all
    select 2,2,1 union all
    select 3,3,1 
    Select cast(a as char(1))+(Case status When 0 Then '(已停用)' else '' End) As a From test
      

  3.   

    注意:
    此处如果a/b字段为int,需要使用cast函数来实现类型转换,也可以使用Rtrim实现
    Select Rtrim(a)+(Case status When 0 Then '(已停用)' else '' End) As a From test
      

  4.   

    sxycgxj(云中客)正解,多谢了~~~~~~~
     else '' 这个很关键,否则是不行的