Difference between "column is null" and "column = null" in where where in db2?

I get different results when I run a query using the suggestion above, but can't figure out why. can anyone explain what is the difference between the two articles.

+4
source share
2 answers

The result of column = null is null, because it is not known that null valid. If you want to check the null value and get the boolean back, you need to use is null . Thus, `column` is null is the correct syntax to use.

+8
source

A comparison with zero is always evaluated as false, so column = null is evaluated as false, and column != null regardless of the value of the column. If you want to check if the value is null, you should use column is null .

+5
source

All Articles