how to count null values in a column in sql code example
Example 1: how to count null values in sql
SELECT COUNT(1) FROM my_table WHERE my_column IS NULL;
Example 2: sql count null values in all columns
SELECT sum(CASE WHEN column_A IS NULL THEN 1 ELSE 0 END) A,
sum(CASE WHEN column_B IS NULL THEN 1 ELSE 0 END) B
FROM my_table;