日期:2014-05-18 浏览次数:20559 次
select count(*)as cnt from sinaMicroBlog where [tag1] is NULL
------解决方案--------------------
[code=sql]
select count(*)as cnt from sinaMicroBlog where [tag1] = ''
--这样写行吗?
[/code]
------解决方案--------------------
select count(*)as cnt from sinaMicroBlog where [tag1] is NULL -- 这是正确的
------解决方案--------------------
select count(*)as cnt from sinaMicroBlog where [tag1] [color=#FF0000]like[/color] NULL select count(*)as cnt from sinaMicroBlog where [tag1] is NULL select sum(isnull(tag1,1)) from sinaMicroBlog
------解决方案--------------------
select count(*)as cnt from sinaMicroBlog where [tag1] is NULL
------解决方案--------------------
判断空值的运算符不是=而是is null和is not null
like是进行近似匹配的,前后有比较近似度的字段或者字符,但like null是不成立的
------解决方案--------------------
select sum(isnull(tag1,1))/2 from sinaMicroBlog
------解决方案--------------------
要取某一行值为空的总和,并显示为空的项目,只有case when?
------解决方案--------------------
在线等。。。