Count of NULL and NOT NULLS
How would I write a query to count the number of instances where a the
PREP field is NULL and when it is not null. I know how to do it
seperately, can I get the numbers in the same query. I want something
like this
Project #PREP_NOTNULL #PREP_NULL
Thanks,
Jim
Re: Count of NULL and NOT NULLS
select concat('isnull(prep) =3D ' ,isnull(prep)) `condition`, count(*)
`count` from your_table group by isnull(prep)
Jim =ED=E0=EF=E8=F1=E0=E2:
> How would I write a query to count the number of instances where a the
> PREP field is NULL and when it is not null. I know how to do it
> seperately, can I get the numbers in the same query. I want something
> like this
>
> Project #PREP_NOTNULL #PREP_NULL
>
> Thanks,
>
> Jim
Re: Count of NULL and NOT NULLS
Thanks,
Is there a way to get the counts in the same ROW
que wrote:
> select concat('isnull(prep) =3D ' ,isnull(prep)) `condition`, count(*)
> `count` from your_table group by isnull(prep)
>
> Jim =ED=E0=EF=E8=F1=E0=E2:
> > How would I write a query to count the number of instances where a the
> > PREP field is NULL and when it is not null. I know how to do it
> > seperately, can I get the numbers in the same query. I want something
> > like this
> >
> > Project #PREP_NOTNULL #PREP_NULL
> >
> > Thanks,
> >
> > Jim
Re: Count of NULL and NOT NULLS
select count(*) nulls, (select count(*) from your_table where not
isnull(prep)) not_nulls from your_table where isnull(prep)
>
> Is there a way to get the counts in the same ROW
>