bug on Subselect with GROUP BY clause

From: Sferacarta Software <sferac(at)bo(dot)nettuno(dot)it>
To: pgsql-hackers(at)postgresql(dot)org
Subject: bug on Subselect with GROUP BY clause
Date: 1999-01-04 13:53:35
Message-ID: 11620.990104@bo.nettuno.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi all,

Seems there's a bug using GROUP BY not on select list on subselects:

SELECT city, AVG(account)
FROM customer
GROUP BY city
HAVING AVG(account) >= ALL
(SELECT city,AVG(account)
FROM customer group by city
);
ERROR: parser: Subselect has too many or too few fields.

Instead the following does work:

SELECT city, AVG(account)
FROM customer
GROUP BY city;
city |avg
--------+---
Chicago | 10
Dallas | 60
New York| 50
(3 rows)

SELECT AVG(account)
FROM customer
GROUP BY city;
avg
---
10
60
50
(3 rows)

-Jose'-

Browse pgsql-hackers by date

  From Date Subject
Next Message The Hermit Hacker 1999-01-04 13:55:57 Re: [HACKERS] a test
Previous Message Sferacarta Software 1999-01-04 13:46:37 too many ANDs ?