pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedGroup By Error Text
2+ messages / 2 participants
[nested] [flat]
* Group By Error Text
@ 2003-01-19 22:36 Joseph Healy <j.healy@ugrad.unimelb.edu.au>
0 siblings, 1 reply; 2+ messages in thread
From: Joseph Healy @ 2003-01-19 22:36 UTC (permalink / raw)
To: pgsql-sql
Hi
with the following query:
select jobno, count(jobno) from drawing_register;
I get the following error:
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?
Regards
Joe Healy
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Group By Error Text
@ 2003-01-19 22:46 Josh Berkus <josh@agliodbs.com>
parent: Joseph Healy <j.healy@ugrad.unimelb.edu.au>
0 siblings, 0 replies; 2+ messages in thread
From: Josh Berkus @ 2003-01-19 22:46 UTC (permalink / raw)
To: Joseph Healy <j.healy@ugrad.unimelb.edu.au>; pgsql-sql
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
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2003-01-19 22:46 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-01-19 22:36 Group By Error Text Joseph Healy <j.healy@ugrad.unimelb.edu.au>
2003-01-19 22:46 ` Josh Berkus <josh@agliodbs.com>
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