select nvl(name,0) from table
or
select nvl(name,'') from table

解决方案 »

  1.   

    同上
    select nvl(null,0) from dual;
      

  2.   

    select nvl(name,0) from table
    or
    select nvl(name,'') from table
      

  3.   

    select nvl(name,0) from table
    or
    select nvl(name,'') from table
      

  4.   

    如果没有数据返回的话,建议使用function完成
      

  5.   

    select nvl(name,0) from table
    or
    select nvl(name,'') from table
      

  6.   

    select nvl(name,0) from table
    or
    select nvl(name,'') from table
    这种写法,我不知道是我写错了还是你们没测
    我用这种写法,达不到sqlserver里的isnull(name,'0')这这种效果。也就是说返回来的这个字段中不会用0来填充它
      

  7.   

    正确写法应该:select nvl(min(name),0) from table
    或:
    select nvl(max(name),0) from table
    但什么意思我也不了解
    刚从网上查到的
      

  8.   

    除了nvl,还可以用 case when...end case的方法,如:
    select case when field1 is null then 0 else field1 end case field1 from table1