differnt behaviour of NULL in an aggregate and with an operator

From: "Willy-Bas Loos" <willybas(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: differnt behaviour of NULL in an aggregate and with an operator
Date: 2008-08-12 08:29:57
Message-ID: 1dd6057e0808120129s6b1d33cdo952ce05d2eb91780@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

Why is it that
SELECT 1+null
evaluates to NULL, but
SELECT sum(foo) FROM (VALUES(1), (NULL)) AS v(foo)
evaluates to 1 ?

WBL

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Craig Ringer 2008-08-12 08:43:14 Re: differnt behaviour of NULL in an aggregate and with an operator
Previous Message Dushyanth 2008-08-12 06:27:48 Re: [Postgresql 8.2.3] autovacuum starting up even after disabling ?