sum() - unexpected results.

From: Jeff MacDonald <jeff(at)hub(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: sum() - unexpected results.
Date: 2001-02-06 03:55:46
Message-ID: Pine.BSF.4.21.0102052353310.3333-100000@rage.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)pgsql(dot)com | jeff(at)hub(dot)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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message a 2001-02-06 04:01:07 max cocurrent connection
Previous Message Franck Martin 2001-02-06 02:36:34 RE: GIS-type databases using PostgreSQL