Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Select not null columns from a table

SoofiDec 24 2020

Hi All,
I need to generate a report which displays the columns which has data.
Here is my example,

image.png
So my sample table has num1 ... num3 and col1.. col3. And you can see there is completely no data for the columns Num2 and Col2 which I need to exclude while generating the report.
My final output should be like this

image.pngNOTE - The above case is just a sample, actual data and number of columns will vary.
What will be best way to achieve this.
I am using Oracle Database 12c (12.2.0.1.0 )
Thanks in advance,
Soofi

Comments

Post Details

Added on Dec 24 2020
7 comments
7,155 views