I have a shape layer with an attribute containing NULL
values to which I would like to apply a filter for values different from NULL
.
Using the available GUI for such query construction, one would intuitively try
"obj_art" != NULL
Which means 'give me all the features with attribute "obj_art"
different from NULL
' (these count definitely more than 0). Testing this query delivers a strange result from my point of view:
So what I've learned so far is that I can achieve this by using
"obj_art" IS NOT NULL
The question is, what is the difference between != NULL
and IS NOT NULL
?
!=
does not mean "is not"; it means "is not equal to".IS NOT
means "is not" so I think this is perfectly intuitive :)NULL
is not a value I would say it is intuitive to try to use=
or!=
as that is how you assess any other value. It's not until you know thatNULL
isn't a value that it's really intuitive to useIS NOT
rather than!=
. Many are not aware of what aNULL
truly is.