--显示的时候改变b的值
select 
    case
        when (a is null) then '2222'
        else b
    end as b
where .......

解决方案 »

  1.   

    select 
        case
            when a is null then '2222'
            else a
        end as 'name'
    where .......
      

  2.   

    case 
           when  a is null
           then  b='2222'
           else  b
           end
      

  3.   

    case b
           when  a is null
           then  '2222'
           else  b
           end
      

  4.   

    好像应该是Update语句:
    Update 表1 set b='2222' where a is null
      

  5.   

    SET ANSI_NULLS OFF
    SELECT 
        CASE Tel 
            WHEN null THEN '001'
            ELSE Tel
        END
        FROM [table_name]
        WHERE [expression]说明:“SET ANSI_NULLS OFF”后才可以捕获NULL值,否则值为NULL的行不会出现在记录集中,想要的功能自然无法实现。