List:General Discussion« Previous MessageNext Message »
From:Sinisa Milivojevic Date:March 20 2001 1:38pm
Subject:Re: query with <> or !=
View as plain text  
Gilles Dumangin writes:
 > Hi,
 > 
 > I have a strange problem happening. I have created an application on a PC 
 > with Mysql-3.23.22-beta and I have different results than on a standard 
 > Mysql-3.23.35.
 > 
 > The main problem seems to be at the following:
 > 
 > Say have 6 rows with a column name "actif", out of these 6 rows 3 have a 
 > NULL value in the actif column and three have the value "No"
 > 
 > is I do
 > 
 > select count(*) from tablename where actif != "Yes" ; or
 > select count(*) from tablename where actif <> "Yes" ;
 > 
 > I get the following results:
 > - development machine: I get results  = 6
 > - production machine: I get results  = 3
 > 
 > Note all rows are different than "Yes", only 3 of them are actually NULL.
 > 
 > OK so that is a fact, but I would like to know if it is just a setting I can 
 > change in the database or if I have to modify the whole program to make sure 
 > these cases don't happen.
 > 
 > Gilles
 > _________________________________________________________________________
 > Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
 > 


Hi!

Between the above versions MySQL has changed treatments of NULL's to
be 100 % ANSI SQL92 compliant.

Simply, now NULL can  not be  equal to anything, including another
NULL.



Regards,

Sinisa

      ____  __     _____   _____  ___     ==  MySQL AB
     /*/\*\/\*\   /*/ \*\ /*/ \*\ |*|     Sinisa Milivojevic
    /*/ /*/ /*/   \*\_   |*|   |*||*|     mailto:sinisa@stripped
   /*/ /*/ /*/\*\/*/  \*\|*|   |*||*|     Larnaca, Cyprus
  /*/     /*/  /*/\*\_/*/ \*\_/*/ |*|____
  ^^^^^^^^^^^^/*/^^^^^^^^^^^\*\^^^^^^^^^^^
             /*/             \*\                Developers Team
Thread
query with <> or !=Gilles Dumangin20 Mar
  • Re: query with <> or !=Sinisa Milivojevic20 Mar
  • selecting null valuesPeter Szekszardi21 Mar
    • RE: selecting null valuesCal Evans21 Mar
    • Re: selecting null valuesroger westin21 Mar
    • Re: selecting null valuesGerald L. Clark21 Mar
    • Re: selecting null valuesWilliam R. Mussatto21 Mar
    • Re: selecting null valuesChihiro Hio21 Mar
    • Re: selecting null valuesPaul DuBois21 Mar
RE: selecting null valuesRick Emery21 Mar
RE: selecting null valuesChris M. Oson21 Mar