pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
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



view thread (5+ messages)  latest in thread

Message-ID: <80k8azqzg4.fsf@junk.nocrew.org>
Permalink:  ../80k8azqzg4.fsf@junk.nocrew.org/
Also on:    postgresql.org/message-id/80k8azqzg4.fsf@junk.nocrew.org

 · 

reply

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