Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

sql count null as 0

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;
 
PREVIOUS NEXT
Tagged: #sql #count #null
ADD COMMENT
Topic
Name
8+4 =