As per below table details Reg_nbr has no null values so in output it is 0, Reg_name is having 3 null values out of 6 records so output it is 50 and Reg_code has only null values so output it is 100
Please help on the query part - in bigquery
1 answers
solution1
1 2022-02-08 17:26:59
Consider below approach
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
if applied to sample data in your question - output is
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.