Subject | Re: [ib-support] SUM + row_count |
---|---|
Author | Tomislav Avramovic |
Post date | 2002-11-24T02:19:18Z |
You'r wrong Helen
From: "Helen Borrie" <helebor@...>
Select sum("Col_1"), count("Col_1") from T where "col_2" = '2' and "Col_1"
is not null;
is equal to
Select sum("Col_1"), count("Col_1") from T where "col_2" = '2';
From: "Helen Borrie" <helebor@...>
> SelectIf some rows have NULL Col_1, sum("Col_1") sums only not null rows
> sum("Col_1") as Total,
> count("Col_1") AS answer
> where "col_2" = '2'
> and "Col_1" is not null;
>
> -- solves the problem. In this case, count ("Col_1") and count(*) would
> deliver the same set.
Select sum("Col_1"), count("Col_1") from T where "col_2" = '2' and "Col_1"
is not null;
is equal to
Select sum("Col_1"), count("Col_1") from T where "col_2" = '2';