I am getting different results when I run the query with above clause but not able to understand why. can any one explain what is the difference between the two clauses.
The result of column = null
is unknown (null), since it can't be known what null
really is. If you want to test for null and get a boolean value back you need to use is null
. So, `column` is null
is the correct syntax to use.
A comparison to null always evaluates to false, so column = null
evaluates to false as well as column != null
, independently of the value of column. If you want to actually check whether a value is null, you have to use column is null
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With