From: Tomas Berndtsson <tomas@nocrew.org>
To: jan.bajerski@viterra.pl
Cc: pgsql-sql@hub.org
Subject: Re:
Date: 23 Oct 2000 18:44:59 +0200
Message-ID: <80k8azqzg4.fsf@junk.nocrew.org> (raw)
References: <OF425EBB1A.C55A43AC-ONC1256981.00534C67@viterra.pl>
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
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: tomas@nocrew.org, jan.bajerski@viterra.pl, pgsql-sql@hub.org
Subject: Re:
In-Reply-To: <80k8azqzg4.fsf@junk.nocrew.org>
* 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