Sql 色调不捕捉空值

Sql 色调不捕捉空值,sql,hue,Sql,Hue,我试图对空值进行计数,但是,它无法对空值进行计数 表格示例: Country Id Id_typ Info Us 123 NULL Testing Us 124 NULL Testing Us 125 Bob testing 这是我计算空值的脚本 select count(id_typ) from combined_a where id_typ= 'NULL' limit 1 我试过了 select count(id_typ) from

我试图对空值进行计数,但是,它无法对空值进行计数

表格示例:

Country Id  Id_typ  Info
Us      123 NULL    Testing
Us      124 NULL    Testing
Us      125 Bob     testing
这是我计算空值的脚本

select count(id_typ) from combined_a where id_typ= 'NULL' limit 1
我试过了

select count(id_typ) from table_a where id_typ is null limit 1

但是,当我将条件更改为search id_typ=bob时,它能够进行计数。我不确定我做错了什么,有什么建议吗?

您需要
为空
计数(*)


限制1
是冗余的。带有聚合函数且无
group by
的SQL查询始终返回一行。

与所有聚合函数COUNT(column)一样,COUNT(列)忽略空值,改为do
COUNT(*)
(不需要限制,反正它是一行)@dnoeth:这可能应该作为答案发布,因为这清楚地解决了OP的问题。
select count(*)
from table_a
where id_typ is null;