Use of GROUP BY

From: "Mihai Gheorghiu" <tanethq(at)earthlink(dot)net>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Use of GROUP BY
Date: 2002-10-02 20:42:03
Message-ID: 00ce01c26a54$2a536220$6e646464@New6.Travel
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

PG7.2.1 on RH7.3
There is no 1234 value in field1.
select sum(amount) from table1 where field1 = 1234;
sum
-----

(1 row)

select sum(amount) from table1 where field1 = 1234 group by field1;
sum
-----
(0 rows)

If GROUP BY should always be used in statements using aggregate functions,
why don't I get an error?

Thank you all.

Browse pgsql-general by date

  From Date Subject
Next Message Oleg Lebedev 2002-10-02 20:45:29 Re: Use of GROUP BY
Previous Message Curtis Faith 2002-10-02 20:13:25 Advice: Where could I be of help?