oracle 统计字段空值数

select sum( case when a is nul then 1 end),
sum( case when b is nul then 1 end),
sum( case when c is nul then 1 end)
from table1 ;

---------------------------------------------------------

select
'a' 字段,
sum( case when a is nul then 1 end)
from table1
union all
select
'b' 字段,
sum( case when b is nul then 1 end)
from table1
select
'c' 字段,
sum( case when c is nul then 1 end)
from table1 ;

 

 

 

          

posted @ 2021-01-20 13:41  rjm123456  阅读(1381)  评论(0编辑  收藏  举报