emmim44 wrote:
> I think it could be if average is zero or null then the
average is 0.... Thanks all
I suspect that is what the author intended. However, the
statement might not return correct results. That expression is
similar to saying:
WHEN AVG(CST.total_calls) = 0 OR AVG(CST.total_calls)
= NULL
NULL is a special value. In most modern databases, null is
never equal to anything. Not even itself. To detect null values you
use the keywords "is null" instead of the equality operator "=".
WHEN AVG(CST.total_calls) = 0 OR AVG(CST.total_calls)
IS NULL
There are also sql functions, like coalesce, that can
automatically replace nulls with another value like 0 or an empty
string, which can be useful in some cases.