Oracle: Finding Columns with only null values

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

    To find rows that have a null-value, use the "is null" condition.

    select * from table_A where table_col1 is null;
    

    To do the reverse, and find all the rows with a non-null value, use the "is not null" condition:

    select * from table_A where table_col1 is not null;
    

    Nulls in range comparisons:

    select * from table_A where table_col1 < 15 or table_col1 is null;
    

提交回复
热议问题