Skip to content
Advertisement

Count NULL values by column in SQL

Suppose I have the following table:

How can I count the number of NULL values by each column?

My final result would be:

Advertisement

Answer

You can use union all:

Redshift is a column-store database, so there probably is not a more efficient method.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement