SQL2000中:
select sum(danjufeishu) as danshu from accession where xianwei=‘0101’
当danshu返回值为null是怎么样将他变为零?

解决方案 »

  1.   

    select ISNULL(sum(danjufeishu),0)  as danshu from accession where xianwei=‘0101’
      

  2.   

    select sum(ISNULL(danjufeishu,0)) as danshu from accession where xianwei=‘0101’
      

  3.   

    sql server 中有相应的判断函数 
    查下帮助 就可以了
      

  4.   

    select sum(ISNULL(danjufeishu,0)) as danshu from accession where xianwei=‘0101’
      

  5.   

    sum(ISNULL(danjufeishu,0))ISNULL(sum(danjufeishu,0))这两个有区别吗?