mysql - Get each column count where column value is not NULL -
i have table , 5 columns in table. want row count each column column value not null.
column1 column2 column3 column4 column5 1 2 2 2 2 2 2 2 null 2 3 null 2 2 null null null 2 2 null null null 2 2 null
i should output 3,2,5,4,2
the solutions offered did not work me. had modify code follows:
select count(nullif(column1,'')), count(nullif(column2,'')), count(nullif(column3,'')), count(nullif(column4,'')), count(nullif(column5,'')) table1
Comments
Post a Comment