On Tue, Jan 08, 2008 at 05:47:53PM +0100, Aristotle Pagaltzis wrote:
> * Gerry Lawrence <gwlp...@gmail.com> [2008-01-08 17:40]:
> > It's..... something altogether different.....
> >
> > mysql> select * from foobar where test123 = NULL;
> 
> Err, that's not how NULL works in SQL. You don't compare things
> to NULL, it's not a value. It's the absence of a value.
> 
> What I'm talking about is this:
> 
>     mysql> CREATE TEMPORARY TABLE test ( d DATE NOT NULL );
>     Query OK, 0 rows affected (0.04 sec)
> 
>     mysql> INSERT INTO test VALUES (0000-00-00);


It doesn't make a difference in this case, but 0000-00-00 isn't what
you think it is. At least, it's not a date in YYYY-MM-DD format. It's
just equal to 0 - 0 - 0 == 0.



Abigail

Attachment: pgpceqK7943ON.pgp
Description: PGP signature

Reply via email to