select count(*) from table1 t1 where t1.id = ''
select count(*) from table t1 where t1.id is null;
select count(*) from table t1 where t1.id != '';
推荐:select count(*) from table t1 where t1.id <> '';
推荐+1:select count(*) from table t1 where ifnull(t1.id,'') = ''; 计数表中所有的空值