Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 315E8476179 for ; Sun, 19 Jan 2003 17:44:22 -0500 (EST) Received: from davinci.ethosmedia.com (unknown [209.10.40.251]) by postgresql.org (Postfix) with ESMTP id B3C0F4760CC for ; Sun, 19 Jan 2003 17:44:18 -0500 (EST) Received: from [66.219.92.2] (HELO chocolate-mousse) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) with ESMTP id 2319204; Sun, 19 Jan 2003 14:44:23 -0800 Content-Type: text/plain; charset="iso-8859-1" From: Josh Berkus Reply-To: josh@agliodbs.com Organization: Aglio Database Solutions To: Joseph Healy , pgsql-sql@postgresql.org Subject: Re: Group By Error Text Date: Sun, 19 Jan 2003 14:46:39 -0800 X-Mailer: KMail [version 1.4] References: <20030119223641.GA1999@joe.hollowcore.com.au> In-Reply-To: <20030119223641.GA1999@joe.hollowcore.com.au> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200301191446.39772.josh@agliodbs.com> X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/291 X-Sequence-Number: 11156 Joe, > ERROR: Attribute drawing_register.jobno must be GROUPed or used in an > aggregate function >=20 > Is this correct? Getting rid of the error is easy: >=20 > select jobno, count(jobno) from drawing_register group by jobno; >=20 > 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=20 jobno, then what you actually wanted to query was: SELECT count(jobno) FROM drawing_register; --=20 -Josh Berkus Aglio Database Solutions San Francisco