I have a table:
table1
col1 col2 col3 col4
a b (null) c
a b (null) c
a (null) (null) c
(null) b (null) (null)
a b (null) (null)
a b (null) (null)
I have about 300 columns in the table. I need to find count of values for each column which are non-null without typing each column name in the table.
The output would be:
column_name count_of_non_null
col1 5
col2 5
col3 0
col4 3
Is there a way to do that?