Re: Select Statement Q!!!
Posted in 1998
Informix handles nulls different than other RDMSs. The only way to select
rows that contain nulls is with the "is null" statement. The "=null" isn't
valid thus != also doesn't count nulls. Informix also conciders all rows
on the right side of an outer to contain a null
ex.
select a.*
from table_a a, outer table_b b
where a.id = b.id and
b.id is null
sounds like it should only return rows in table a where there are no
matching rows in table b. "sorry", it'll return all rows.
Scott Kolaya
Pinto, Raymond <PINTOR@valuerx.com> wrote in article
<6di87g$6in$1@news.xmission.com>...
>
> Q. I have a query
>
> > select count(*) from table_a
> > where fld1 != 'A'> >
> > I get a count = 7000
> > fld1 is char(1)
> > There are 100000 records with fld1 = null
> >
> > This query does not count the null values
> >
> > From what I can see , Informix does not count the null values. Is this
> > a bug or is this the way it is supposed to work
> >
> > Thanks in advance
> >
> > Raymond Pinto
> > pinto@valuerx.com
> >
>