(re:) Mysql comparison of DATE of  0000-00-00 to NULL


It's not equal to null.
It's not not equal to null.
It's not greater than null.
It's not less than null.
It's not rlike null.
It's not <> null......


It's..... something altogether different.....



-----------------------------------------
mysql> describe foobar;

+---------+------+------+-----+---------+-------+
| Field   | Type | Null | Key | Default | Extra |
+---------+------+------+-----+---------+-------+
| test123 | date | YES  |     | NULL    |       |
+---------+------+------+-----+---------+-------+
1 row in set (0.00 sec)



mysql> select * from foobar;
test123
0000-00-00
0000-00-00

2 rows in set (0.00 sec)



mysql> select * from foobar where test123 = NULL;
Empty set (0.00 sec)

mysql> select * from foobar where test123 != NULL;
Empty set (0.00 sec)

mysql> select * from foobar where test123 > NULL;
Empty set (0.00 sec)

mysql> select * from foobar where test123 < NULL;
Empty set (0.00 sec)

mysql> select * from foobar where test123 rlike  NULL;
Empty set (0.00 sec)

mysql> select * from foobar where test123 <>  NULL;
Empty set (0.00 sec)






H.Merijn Brand wrote:
On Tue, 8 Jan 2008 11:06:37 +0100, Aristotle Pagaltzis <pagalt...@gmx.de>
wrote:

* Philip Newton <philip.new...@gmail.com> [2008-01-08 09:50]:
Offender #1 being that '' is not the same as NULL, and Oracle
shouldn't pretend otherwise.
Piffle. If you think you can beat MySQL with *that*, you are
really quite naïve. MySQL pushes that sort of hate to the 11th
dimension. It considers the date 0000-00-00 *both* NULL *and*
NOT NULL... *at the same time*. It's a quantum stuporposition.

OOOOH! Yeah! I have to include that in my DBD hate talk.
Thanks!


Reply via email to