select 完好= isnull(wh,0) from jx_scyyqkb where month(insert_time)=1

解决方案 »

  1.   

    select 完好=(case when wh is Null then 0 else wh end) from jx_scyyqkb where month(insert_time)=1select case when month(insert_time)=1 then isnull(wh,0) end from jx_scyyqkb select 完好=isnull(wh,0) from jx_scyyqkb where month(insert_time)=1
      

  2.   

    不能用=null的 判断null 要用 is null 
    如果要对null值替换就用 isnull函数
      

  3.   

    注意以下几个关键词的用法问题不能用=null,因该为=‘’
    如果判断null 应该is null 如果要对null值替换就用 isnull函数
      

  4.   

    select decode(wh,o) from jx_scyyqkb where month(insert_time)=1
      

  5.   

    select decode(wh,o) as wh from jx_scyyqkb where month(insert_time)=1
      

  6.   

    建立一个辅助表TABLE2
    if exists(select * from table1)
    select * from table1
    else
    select * from TABLE2真的很笨.我说的是方法噢!