SELECT NULL; prints
<null>
SELECT CAST('0000-00-00' AS DATE); prints
<null>
SELECT NULL IS NULL; prints
1
SELECT CAST('0000-00-00' AS DATE) IS NULL; prints
0
Why isn't the result of the 4th statement 1?
Tested using DataGrip while connecting to MySQL 5.7.17 on windows.

Because the 2. isn't true:
SELECT CAST('0000-00-00' AS DATE); prints
0000-00-00
It doesn't print
NULL

4th statement show the result 0000-00-00
In mysql Only null is null. Everything else is not, so that it returns 1

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