pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feed(no subject)
5+ messages / 5 participants
[nested] [flat]
* (no subject)
@ 2000-10-23 15:11 jan.bajerski@viterra.pl
0 siblings, 4 replies; 5+ messages in thread
From: jan.bajerski@viterra.pl @ 2000-10-23 15:11 UTC (permalink / raw)
To: pgsql-sql@hub.org
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 ?
Yours Jan Bajerski
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re:
@ 2000-10-23 16:30 Stephan Szabo <sszabo@megazone23.bigpanda.com>
parent: jan.bajerski@viterra.pl
3 siblings, 0 replies; 5+ messages in thread
From: Stephan Szabo @ 2000-10-23 16:30 UTC (permalink / raw)
To: jan.bajerski@viterra.pl; +Cc: pgsql-sql@hub.org
On Mon, 23 Oct 2000 jan.bajerski@viterra.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).
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re:
@ 2000-10-23 16:44 Tomas Berndtsson <tomas@nocrew.org>
parent: jan.bajerski@viterra.pl
3 siblings, 0 replies; 5+ messages in thread
From: Tomas Berndtsson @ 2000-10-23 16:44 UTC (permalink / raw)
To: jan.bajerski@viterra.pl; +Cc: pgsql-sql@hub.org
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
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re:
@ 2000-10-23 18:09 bmccoy@chapelperilous.net
parent: jan.bajerski@viterra.pl
3 siblings, 0 replies; 5+ messages in thread
From: bmccoy@chapelperilous.net @ 2000-10-23 18:09 UTC (permalink / raw)
To: jan.bajerski@viterra.pl; +Cc: pgsql-sql@hub.org
On Mon, 23 Oct 2000 jan.bajerski@viterra.pl wrote:
> 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(*)
^^^^ ^^^^
What table do these come from?
> FROM kart k, pictues p
^^^^^^^^
This looks like a typo
> 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 ?
Probably the query.
Brett W. McCoy
http://www.chapelperilous.net
---------------------------------------------------------------------------
The goys have proven the following theorem...
-- Physicist John von Neumann, at the start of a classroom
lecture.
^ permalink raw reply [nested|flat] 5+ messages in thread
* Large Objects
@ 2000-10-24 10:07 Craig May <craig.may@s2.enthdimension.com.au>
parent: jan.bajerski@viterra.pl
3 siblings, 0 replies; 5+ messages in thread
From: Craig May @ 2000-10-24 10:07 UTC (permalink / raw)
To: pgsql-sql
Hi,
Could someone please provide a demo of creating the type "Lo".
Regards,
Craig May
Enth Dimension
http://www.enthdimension.com.au
^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2000-10-24 10:07 UTC | newest]
Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2000-10-23 15:11 jan.bajerski@viterra.pl
2000-10-23 16:30 ` Re: Stephan Szabo <sszabo@megazone23.bigpanda.com>
2000-10-23 16:44 ` Re: Tomas Berndtsson <tomas@nocrew.org>
2000-10-23 18:09 ` Re: bmccoy@chapelperilous.net
2000-10-24 10:07 ` Large Objects Craig May <craig.may@s2.enthdimension.com.au>
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