Re: Should Aggregate Functions always return one row?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Should Aggregate Functions always return one row?
Дата
Msg-id 16437.1074998751@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Should Aggregate Functions always return one row?  (wilhelm.pakulla@gmx.de)
Список pgsql-bugs
wilhelm.pakulla@gmx.de writes:
> So, if I use the max() aggregate, I receive one row with the value NULL. Is
> that correct?

Yup, that's what the SQL spec says to do, and it seems reasonable to me.

IIRC, the spec also says that SUM() over no rows returns NULL, which is
less reasonable --- I'd have defined it as returning zero, myself.
But when in doubt we follow the spec.

            regards, tom lane

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

Предыдущее
От: wilhelm.pakulla@gmx.de
Дата:
Сообщение: Should Aggregate Functions always return one row?
Следующее
От: "PostgreSQL Bugs List"
Дата:
Сообщение: BUG #1066: avg(age()) results months with more than 30 days