Re: unhelpful error message - Mailing list pgsql-bugs

From Tom Lane
Subject Re: unhelpful error message
Date
Msg-id 6912.1245333801@sss.pgh.pa.us
Whole thread Raw
In response to unhelpful error message  (hubert depesz lubaczewski <depesz@depesz.com>)
Responses Re: unhelpful error message
Re: unhelpful error message
List pgsql-bugs
hubert depesz lubaczewski <depesz@depesz.com> writes:
> # create table sold_products (items int4, product_id int4);
> # create table products (id int4, codename text);
> # select sp.count, p.codename from sold_products sp join products p on sp.product_id = p.id;

> shown error:
> ERROR:  column "p.codename" must appear in the GROUP BY clause or be used in an aggregate function
> LINE 1: select sp.count, p.codename from sold_products sp join produ...
>                          ^

Per the fine manual, sp.count is another way of writing count(sp).
Does it make more sense now?

            regards, tom lane

pgsql-bugs by date:

Previous
From: hubert depesz lubaczewski
Date:
Subject: unhelpful error message
Next
From: hubert depesz lubaczewski
Date:
Subject: Re: unhelpful error message