sum() - unexpected results.

Поиск
Список
Период
Сортировка
От Jeff MacDonald
Тема sum() - unexpected results.
Дата
Msg-id Pine.BSF.4.21.0102052353310.3333-100000@rage.hub.org
обсуждение исходный текст
Ответы Re: sum() - unexpected results.  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: sum() - unexpected results.  (Tod McQuillin <devin@spamcop.net>)
Список pgsql-general
Hi,

I got some unexpected results from a sum().. just wondering
if it's a bug of any sort, or if i just should have been expecting it..

SELECT sum(foo) FROM mytable WHERE active = 1;

Now lets say that no rows are active = 1, then this query returns
1 blank row..

I would have expected either
    1:    a result of zero
        or
    2:     zero rows returned..

oh, btw this is pgsql 7.0.2 on fbsd.

anyone ?

Jeff MacDonald,

-----------------------------------------------------
PostgreSQL Inc        | Hub.Org Networking Services
jeff@pgsql.com        | jeff@hub.org
www.pgsql.com        | www.hub.org
1-902-542-0713        | 1-902-542-3657
-----------------------------------------------------
Facsimile : 1 902 542 5386
IRC Nick  : bignose
PGP Public Key : http://bignose.hub.org/public.txt


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

Предыдущее
От: ender
Дата:
Сообщение: Re: Longer and longer updates
Следующее
От: Craig Orsinger
Дата:
Сообщение: Re: MS Excel to PostgreSQL?