
4个回答
展开全部
select count(isnull(字段名)) as '空值', count(not isnull(字段名)) as '非空值'
from 表
试试。
追问
结果报错
isnull 函数要求有2个参数
展开全部
select sum((case when col1 is null then 1 else 0 end))空值,
sum((case when col1 is not null then 1 else 0 end)) 非空值,
from table_name
sum((case when col1 is not null then 1 else 0 end)) 非空值,
from table_name
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
select count(字段) 非空值, count(case when 字段 is null then 1 end) 空值
from 表
from 表
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
select a.a as '空值', b.b as '非空值' from
(select count(字段) as a from 表名 where 字段 is null )a,
(select count(字段) as b from 表名 where 字段 is not null ) b
(select count(字段) as a from 表名 where 字段 is null )a,
(select count(字段) as b from 表名 where 字段 is not null ) b
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询