Is there a way to select the column names of a certain table except those columns with only null values without knowing how many columns the table have.
-------------------------
| col1 | col2 | col3 |
------------------------
| val1 | null | val2 |
| val1 | null | null |
| null | null | val2 |
-------------------------
Should result in:
------------------------------------
| cols_except_those_with_null_only |
-----------------------------------
| col1 |
| col3 |
------------------------------------
Thanks!
Create a stored procedure with following content: