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'-



Mon, 4 Jan 1999 14:53:35 +0100
Sferacarta Software <sferac@bo.nettuno.it>
bug on Subselect with GROUP BY clause