Tom Lane wrote:
>
> SUM() over no rows returns NULL, not zero, per the SQL spec.
I knew that, but didn't see the implications ... i.e. "IF FOUND" always
returns true ...
> Try testing total_sales for NULL instead.
I was thinking of that but I declared it of type INTEGER. I thought it
made no sense to have an integer with a NULL value but it it works, I'm
happy :)
Thanks!
Jc