select COLUMN_NAME
from sys.all_tab_columns col
inner join sys.all_tables t on col.owner = t.owner
and col.table_name = t.table_name
where
col.table_name = 'SHRDGMR'
AND (NUM_DISTINCT > 0 or density > 0)
order by col.column_id;
select COLUMN_NAME
from sys.all_tab_columns col
inner join sys.all_tables t on col.owner = t.owner
and col.table_name = t.table_name
where
col.table_name = 'REPLACE THIS WITH YOUR TABLE NAME'
AND NUM_DISTINCT > 0
order by col.column_id;