Oracle: Finding Columns with only null values

前端 未结 8 2074
温柔的废话
温柔的废话 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:33

    You can identify by using the below query :

    select * from (select ascii(t.col2)+ascii(t.col4)+ascii(t.col1)+ascii(t.col3) col from test_null_col t)
    where col is null;
    

    And you want to delete null column rows here is query :

    delete from
    (select ascii(t.col2)+ascii(t.col4)+ascii(t.col1)+ascii(t.col3) col from test_null_col t)
    where col is null;
    

提交回复
热议问题