我需要编写一个select查询来查找全文字段为空但由于某种原因两者都有的行数:
select count(id) from table where field is null;和
select count(id) from table where field = "";看起来不管用!
还有什么?!
发布于 2010-04-23 19:10:20
如果这不起作用..。你可以试试
其中len( trim( field )) =0
发布于 2010-04-23 18:58:11
select
count(id)
from
table
where
isnull(field);但是,您的"field is null“查询应该可以工作(至少对我来说是这样)。
发布于 2010-04-23 20:53:47
当您说它们不工作时,您是指返回空字段和非空字段,还是什么都不返回?
如果你得到了empty和非empty,试着用PHP来测试返回的is_null或is_string。也许里面有一些空格或者类似的东西?
https://stackoverflow.com/questions/2697923
复制相似问题