pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Sullivan <ajs@crankycanuck.ca>
To: pgsql-sql@postgresql.org
Subject: Re: help with pagila
Date: Fri, 1 Sep 2006 11:21:16 -0400
Message-ID: <20060901152116.GE17178@phlogiston.dyndns.org> (raw)
In-Reply-To: <32cabba0609010631t233d13f9o38edba0483a2446c@mail.gmail.com>
References: <32cabba0609010631t233d13f9o38edba0483a2446c@mail.gmail.com>

On Fri, Sep 01, 2006 at 10:31:48AM -0300, Walter Cruz wrote:
> "ERROR:  column "film.description" must appear in the GROUP BY clause or be
> used in an aggregate function"
> 
> If I put that column on GROUP BY everything works ok. But I want understant
> why do I need to do that. Can someone teach me, please?

You need to because everything else is being grouped or aggregated.
Otherwise, you should get one row for every match of
film.description, and that's not what you want.  (More precisely and
yet still completely imprecise, that's not even something you can
have, because of the way sets work.)

A

-- 
Andrew Sullivan  | ajs@crankycanuck.ca
In the future this spectacle of the middle classes shocking the avant-
garde will probably become the textbook definition of Postmodernism. 
                --Brad Holland



view thread (11+ messages)  latest in thread

Message-ID: <20060901152116.GE17178@phlogiston.dyndns.org>
Permalink:  ../20060901152116.GE17178@phlogiston.dyndns.org/
Also on:    postgresql.org/message-id/20060901152116.GE17178@phlogiston.dyndns.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: ajs@crankycanuck.ca
  Subject: Re: help with pagila
  In-Reply-To: <20060901152116.GE17178@phlogiston.dyndns.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