如何获取bigquery中每一列的空值count/percentage
How to get the null value count/percentage for each columns in bigquery
表名='Header'
根据下面的 table 详细信息 Reg_nbr 没有空值,所以在输出中它是 0
, Reg_name 在 6 条记录中有 3 个空值,因此输出为 50
Reg_code 只有空值,所以输出为 100
请帮助查询部分 - 在 bigquery
考虑以下方法
select
100 * countif(Reg_nbr is null) / count(1) as Reg_nbr,
100 * countif(Reg_Name is null) / count(1) as Reg_Name,
100 * countif(Reg_Code is null) / count(1) as Reg_Code
from your_table
如果应用于您问题中的示例数据 - 输出为
表名='Header'
根据下面的 table 详细信息 Reg_nbr 没有空值,所以在输出中它是 0 , Reg_name 在 6 条记录中有 3 个空值,因此输出为 50 Reg_code 只有空值,所以输出为 100
请帮助查询部分 - 在 bigquery
考虑以下方法
select
100 * countif(Reg_nbr is null) / count(1) as Reg_nbr,
100 * countif(Reg_Name is null) / count(1) as Reg_Name,
100 * countif(Reg_Code is null) / count(1) as Reg_Code
from your_table
如果应用于您问题中的示例数据 - 输出为