sql count null as 0

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

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
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;