sql count null as 0

Solutions on MaxInterview for sql count null as 0 by the best coders in the world

showing results for - "sql count null as 0"
Hanae
14 Jun 2017
1SELECT sum(CASE WHEN column_A IS NULL THEN 1 ELSE 0 END) A,
2       sum(CASE WHEN column_B IS NULL THEN 1 ELSE 0 END) B
3FROM my_table;