From: Josh Berkus <josh@agliodbs.com>
To: Joseph Healy <j.healy@ugrad.unimelb.edu.au>
To: pgsql-sql@postgresql.org
Subject: Re: Group By Error Text
Date: Sun, 19 Jan 2003 14:46:39 -0800
Message-ID: <200301191446.39772.josh@agliodbs.com> (raw)
In-Reply-To: <20030119223641.GA1999@joe.hollowcore.com.au>
References: <20030119223641.GA1999@joe.hollowcore.com.au>
Joe,
> ERROR: Attribute drawing_register.jobno must be GROUPed or used in an
> aggregate function
>
> Is this correct? Getting rid of the error is easy:
>
> select jobno, count(jobno) from drawing_register group by jobno;
>
> I believe that jobno is being used in an aggregate function. Should a
> change be made to the error text?
Nope. The error message is exactly correct. If you didn't want to GROUP BY
jobno, then what you actually wanted to query was:
SELECT count(jobno) FROM drawing_register;
--
-Josh Berkus
Aglio Database Solutions
San Francisco
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: josh@agliodbs.com, j.healy@ugrad.unimelb.edu.au
Subject: Re: Group By Error Text
In-Reply-To: <200301191446.39772.josh@agliodbs.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox