刘政道 - 应用程序框架

《31天学会CRM项目开发(C#编程入门及项目实战)》作者,IT经理,程序员
  博客园  :: 新随笔  :: 联系 :: 管理

sum()的值为null,如何让它变成0

Posted on 2008-08-26 17:08  刘政道  阅读(788)  评论(1编辑  收藏  举报

select sum(field1) as r from table1

r is null

如何让r变成0

select isnull(sum(field1),0) as r from table1

r 不在是null,而是0