Skip site navigation (1) Skip section navigation (2)

Re:

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: jan(dot)bajerski(at)viterra(dot)pl
Cc: pgsql-sql(at)hub(dot)org
Subject: Re:
Date: 2000-10-23 16:30:56
Message-ID: Pine.BSF.4.10.10010230924420.12023-100000@megazone23.bigpanda.com (view raw or flat)
Thread:
Lists: pgsql-sql
On Mon, 23 Oct 2000 jan(dot)bajerski(at)viterra(dot)pl wrote:

> 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 ?

AFAICS, the above construct isn't a legal
GROUP BY query.  All columns in the select
list must either be grouped columns or 
in some sort set value function.

Assuming that pictures.pic is unique, you
can add p.id_g and p.id_k to the group
by clause.  Otherwise, you need to decide
which id_g and id_k you want (min or 
max is often useful).



In response to

  • at 2000-10-23 15:11:06 from jan.bajerski

pgsql-sql by date

Next:From: Tomas BerndtssonDate: 2000-10-23 16:44:59
Subject: Re:
Previous:From: jan.bajerskiDate: 2000-10-23 15:11:06
Subject:

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group