create table t(a int,b int)
insert t values(1,null)
insert t values(2,1)
insert t values(3,null)select count(b) from t where b is not null
select count(b),count(*),count(IsNull(b,0)) from t where b is null
----------- ----------- -----------
0 2 2(所影响的行数为 1 行)
insert t values(1,null)
insert t values(2,1)
insert t values(3,null)select count(b) from t where b is not null
select count(b),count(*),count(IsNull(b,0)) from t where b is null
----------- ----------- -----------
0 2 2(所影响的行数为 1 行)
解决方案 »
- 查询后合并
- 事务的应用
- sqlserveropenrowset导入Access数据库,发生Cannot start your application. The workgroup information file is missing or opened excl
- 如何突破varchar 8000个字符的限制?
- 高级查询
- 实现2个触发器
- 关于触发器的触发动作之前的语法
- 请问primary key的数量多少和数据库的查询,插入,更新的速度是否有很大关系???(xiaoluo)
- 如何用SQL语句实现,使多条重复的记录,只剩下一条记录,其余的都删掉?
- 在“已经生成”的报表内用"语句"添加“一个字段”(VFP)?
- 字段自动加一,是什么类型
- 高手请进,挑战性的SQL问题
count(b)本来就不返回null,
所以select count(b) from t where b is null 结果一定是0
你也要给微软出错的机会阿!