X-Original-To: pgsql-sql-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 5D6AB9FB478 for ; Fri, 1 Sep 2006 14:14:32 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 09029-02-9 for ; Fri, 1 Sep 2006 14:13:53 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from main2.mycybernet.net (main2.mycybernet.net [209.222.63.140]) by postgresql.org (Postfix) with ESMTP id 5F0329FB8EC for ; Fri, 1 Sep 2006 12:21:22 -0300 (ADT) Received: from 227-54-222-209.mycybernet.net ([209.222.54.227] helo=phlogiston.dydns.org) by main2.mycybernet.net with esmtp (Exim 4.62) (envelope-from ) id 1GJB3q-0004lh-Gb for pgsql-sql@postgresql.org; Fri, 01 Sep 2006 11:36:02 -0400 Received: by phlogiston.dydns.org (Postfix, from userid 1000) id C78864051; Fri, 1 Sep 2006 11:21:16 -0400 (EDT) Date: Fri, 1 Sep 2006 11:21:16 -0400 From: Andrew Sullivan To: pgsql-sql@postgresql.org Subject: Re: help with pagila Message-ID: <20060901152116.GE17178@phlogiston.dyndns.org> References: <32cabba0609010631t233d13f9o38edba0483a2446c@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <32cabba0609010631t233d13f9o38edba0483a2446c@mail.gmail.com> User-Agent: Mutt/1.5.9i X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.219 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200609/2 X-Sequence-Number: 26213 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