I know I can use this query to get all column names for a given table:
select column_name from all_tab_columns where table_name='my_table';
And I can use this query to calculate the percentage of non-null values for a given column in a table:
select count(col_1) / count(*), count(col_2) / count(*)
from my_table
But I want to combine these two queries to get the percentage of non-null values for all columns in a given table (without having to manually type out the column names for each table)
desired output for a given table:
column_name, completeness
col_1, 0.8
col_2, 1.0
col_3, 0.0
Is it possible to do this with only Select statements (no PL/SQL loops)?