Re: select null + 0 question

From: Joe Conway <mail(at)joeconway(dot)com>
To: Jean-Christian Imbeault <jc(at)mega-bucks(dot)co(dot)jp>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: select null + 0 question
Date: 2003-07-14 06:12:35
Message-ID: 3F1249D3.1090303@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Jean-Christian Imbeault wrote:
> Shouldn't the sum() and "+" operators behave the same?

No, see SQL99, Section 6.16, General Rules 1.b:

"Otherwise, let TX be the single-column table that is the result of
applying the <value expression> to each row of T and eliminating null
values. If one or more null values are eliminated, then a completion
condition is raised: warning — null value eliminated in set function."

I've never seen a database that emits the required warning, though.

Joe

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Vincent Hikida 2003-07-14 06:14:15 Fw: select null + 0 question
Previous Message listrec 2003-07-14 06:11:59 Re: select null + 0 question