bug on Subselect with GROUP BY clause - Mailing list pgsql-hackers

From Sferacarta Software
Subject bug on Subselect with GROUP BY clause
Date
Msg-id 11620.990104@bo.nettuno.it
Whole thread Raw
List 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
---106050
(3 rows)

-Jose'-




pgsql-hackers by date:

Previous
From: Sferacarta Software
Date:
Subject: int4 range
Next
From: Sferacarta Software
Date:
Subject: too many ANDs ?