List:General Discussion« Previous MessageNext Message »
From:Roger Baklund Date:September 19 2005 1:40am
Subject:Re: Yet another null question
View as plain text  
doug@stripped wrote:
> I did not expect that null was not not-equal to 1. 

Any comparison with NULL returns NULL:

mysql> select null<>1,null>1,null<1,null=1;
+---------+--------+--------+--------+
| null<>1 | null>1 | null<1 | null=1 |
+---------+--------+--------+--------+
|    NULL |   NULL |   NULL |   NULL |
+---------+--------+--------+--------+
1 row in set (0.00 sec)

This is the correct and desired behaviour.

<URL: http://dev.mysql.com/doc/mysql/en/null-values.html >
<URL: http://dev.mysql.com/doc/mysql/en/working-with-null.html >
<URL: http://dev.mysql.com/doc/mysql/en/problems-with-null.html >

-- 
Roger

Thread
Yet another null questiondoug19 Sep
  • Re: Yet another null questionRoger Baklund19 Sep
    • Re: Yet another null questiondoug19 Sep
      • Re: Yet another null questionJasper Bryant-Greene19 Sep
      • Re: Yet another null questionJoerg Bruehe20 Sep
        • Re: Yet another null questiondoug20 Sep
    • Re: Yet another null questiondoug19 Sep
  • Re: Yet another null questionMartijn Tonies19 Sep
    • Re: Yet another null questiondoug19 Sep