Assuming my_column
is a VARCHAR2
, it sounds like you just want
SELECT *
FROM my_table
WHERE my_column IS NOT NULL
You'd never want to check whether my_column = null
or my_column != null
. Regardless of the value of my_column
, those predicates will always evaluate to false. No value is ever equal to NULL
and no value is ever unequal to NULL
, not even another NULL
value. Oracle does not have the concept of an empty string. You'd either have a NULL
or you'd have a string with one or more spaces or some other filler character. So there is no need to check whether the value is empty, just check whether it is NULL
.