Re: PL/PGSQL question - Mailing list pgsql-general

From Jean-Christian Imbeault
Subject Re: PL/PGSQL question
Date
Msg-id 3E27A0FB.30400@mega-bucks.co.jp
Whole thread Raw
In response to PL/PGSQL question  (Jean-Christian Imbeault <jc@mega-bucks.co.jp>)
List pgsql-general
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


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: PL/PGSQL question
Next
From: Jean-Christian Imbeault
Date:
Subject: PL/PGSQL: another Q