什么是为Hive表中的100多列中的每一列返回COUNT个NULL值的SQL代码?
答案 0 :(得分:2)
在SQL中它将是
SELECT
SUM(CASE WHEN a is null then 1 else 0 end) as a_null_count,
SUM(CASE WHEN b is null then 1 else 0 end) as b_null_count,
--- ...
SUM(CASE WHEN z is null then 1 else 0 end) as z_null_count
FROM table