select null + 0 question

Поиск
Список
Период
Сортировка
От Jean-Christian Imbeault
Тема select null + 0 question
Дата
Msg-id 3F1242C2.8080802@mega-bucks.co.jp
обсуждение исходный текст
Ответы Re: select null + 0 question  ("listrec" <listrec@epecon.de>)
Re: select null + 0 question  (Joe Conway <mail@joeconway.com>)
Re: select null + 0 question  (Mike Mascari <mascarm@mascari.com>)
Список pgsql-general
Why is it that "select null + 1" gives null but "select sum(a) from
table" where there are null entries returns an integer?

Shouldn't the sum() and "+" operators behave the same?

TAL=# select null + 0;
  ?column?
----------

(1 row)

TAL=# select * from a;
  a
---


  1
(3 rows)

TAL=# select sum(a) from a;
  sum
-----
    1
(1 row)


Thanks,

Jean-Christian Imbeault


В списке pgsql-general по дате отправления:

Предыдущее
От: Jim Rosenberg
Дата:
Сообщение: Re: OS X installation with readline support
Следующее
От: Ron Johnson
Дата:
Сообщение: Re: Is SQL silly as an RDBMS<->app interface?