如何将空值NULL替换为其他文字
例如
a        b        c
-----------------------
11      11        null
22      22        22
33      33        null
12      12        32要求显示
a        b        c
-----------------------
11      11        不存在
22      22        22
33      33        不存在
12      12        32
该如何写SQL语句  谢谢各位大虾

解决方案 »

  1.   

    select a,b,isnull(c,'不存在') from [table]
      

  2.   

    表有点错误  应该类似于
    a        b        c
    -----------------------
    11      11        null
    22      null        22
    33      33        null
    12      null       32要求显示
    a        b        c
    -----------------------
    11      11        不存在
    22    不存在        22
    33      33        不存在
    12    不存在       32
      

  3.   

    isnull(b,'不存在'),isnull(c,'不存在')
      

  4.   

    select id,case 
           when  num is NULL then '不存在'
           else num
           end as num
    from dbo.a
      

  5.   

    select a,(case when b is null then '不存在' else rtrim(b) end)b,
           (case when c is null then '不存在' else rtrim(c) end)c
    from 表名