On Wed, Jun 13, 2007 at 12:50:03PM -0700, Mufaddal Khumri wrote:
> mysql> select * from t1 where sid != 2;
> 
> As you can see, the rows that had sid = NULL did not get returned in  
> the results when i did "... where sid != ; "
> 
> Question: Is this behaviour correct and is in accordance to the SQL  
> standard or is it specific to MySQL ?

It is in accordance to the standard. NULL is not equal to anything,
and it is not unequal to anything. NULL is just the magic ineffable
NULL. If you want your NULL rows too you must use:

  SELECT * FROM t1 WHERE sid !=2 OR sid IS NULL;

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to