怎么使Count最小返回值为0不为Null
2个回答
展开全部
3楼: select count(table_name) as countnum from table
if count(table_name) is null
set countnum=0
select countnum
4楼: select num=isnull(count([columnname]),0) from [table]
5楼: 什么意思?count本来就不会返回null值啊!如sqlserver 服务管理器没
6楼: select count(isnull(columnname,0)) as count_cloumname
form tablename
在所有有可能为NULL的字段在参加运算时,都加上
ISNULL(列名,替换值)
否则运算结果就变NULL了
7楼: select isnull(count,10) as count_cloumname
form tablename
where isnull(count,10)=0
if count(table_name) is null
set countnum=0
select countnum
4楼: select num=isnull(count([columnname]),0) from [table]
5楼: 什么意思?count本来就不会返回null值啊!如sqlserver 服务管理器没
6楼: select count(isnull(columnname,0)) as count_cloumname
form tablename
在所有有可能为NULL的字段在参加运算时,都加上
ISNULL(列名,替换值)
否则运算结果就变NULL了
7楼: select isnull(count,10) as count_cloumname
form tablename
where isnull(count,10)=0
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询