Oracle: Finding Columns with only null values

前端 未结 8 2081
温柔的废话
温柔的废话 2021-01-17 21:11

I have a table with a lot of columns and a type column.

Some columns seem to be always empty for a specific type.

I want to create a view for each type and o

8条回答
  •  太阳男子
    2021-01-17 21:52

    SELECT  t.column_name
    FROM    user_tab_columns t
    WHERE   t.nullable = 'Y'
            AND t.table_name = 'YOUR_TABLE_NAME'
            AND t.num_distinct = 0
    

提交回复
热议问题