Received: from junk.nocrew.org (mail@[212.73.17.42]) by hub.org (8.10.1/8.11.0) with ESMTP id e9NGjA346666 for ; Mon, 23 Oct 2000 12:45:12 -0400 (EDT) (envelope-from tomas@junk.nocrew.org) Received: from tomas by junk.nocrew.org with local (Exim 3.12 #1 (Debian)) id 13nkiZ-0004uP-00; Mon, 23 Oct 2000 18:44:59 +0200 To: jan.bajerski@viterra.pl Cc: Subject: Re: References: From: Tomas Berndtsson Date: 23 Oct 2000 18:44:59 +0200 In-Reply-To: jan.bajerski@viterra.pl's message of "Mon, 23 Oct 2000 17:11:06 +0200" Message-ID: <80k8azqzg4.fsf@junk.nocrew.org> Lines: 29 User-Agent: Gnus/5.0803 (Gnus v5.8.3) Emacs/20.7 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Archive-Number: 200010/192 X-Sequence-Number: 1854 jan.bajerski@viterra.pl writes: > Hello, > I have following problem with PostgreSQL 6.5.3, I haven't possiblity > to check it on 7.0 and I want to know is it possible to run such query: > > SELECT k.pic, id_g, id_k, count(*) > FROM kart k, pictues p > WHERE k.pic = p.pic > GROUP BY k.pic > > PICTURES(pic,id_g,id_k) > KART (pic,email,mess,date) > > I've got answer from Postgres > "Illegal attributes or non-group column" > > Is it error in query or in parser ? You need to have all non-aggragated columns in the GROUP BY: SELECT k.pic, id_g, id_k, count(*) FROM kart k, pictues p WHERE k.pic = p.pic GROUP BY k.pic, id_g, id_k Tomas