Markus Schaber <[EMAIL PROTECTED]> writes:
> I just stumbled over a slightly confused error message:

> mydb=# select count(*),coverage_area from myschema.streets except select
> cd as coverage_area from countryref.disks group by streets.coverage_area;
> ERROR:  column "streets.coverage_area" must appear in the GROUP BY
> clause or be used in an aggregate function

> As the query looks, streets.coverage_area is actually used in the GROUP BY.

The complaint is 100% accurate; the subquery that it's unhappy about is

        select count(*),coverage_area from myschema.streets

which is an aggregating query, but coverage_area is being used outside
an aggregate without having been grouped by.

                        regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to [EMAIL PROTECTED] so that your
       message can get through to the mailing list cleanly

Reply via email to