Re: where != and NULLs
Posted in 1996
I think this same in all informix versions. Nilesh K. Peter Wages <pmwages@cais.com> wrote in article <4vsllu$e0k@cssun.mathcs.emory.edu>... > Peculiar Circumstance in Version 7. Is this a bug? > > Do an agregate query > > > select sum(column_1) > from table_a > where column_2 != 'value' > > If column_2 is NULL for some records, the sum of column_1 will be > incorrect. To get the correct sum the query has to be written > > select sum(column_1) from table_a > where column_2 != 'value' or column_2 is NULL > > Me thinks there is a logic problem here. If column_2 is NULL then > column_2 != 'value' > > This is a big nuissance. > > ciao > p > > **************************************************************************** ** > Peter Wages > EDS Arlington, Virginia > pmwages@cais.com > Work: (703) 741-7436 Home: (202) 244-3511 > Anywhere is walking distance, if you have the time > **************************************************************************** ** > > >