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 A4C969FB52F for ; Fri, 1 Sep 2006 16:52:12 -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 24555-02-2 for ; Fri, 1 Sep 2006 16:51:56 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from nz-out-0102.google.com (nz-out-0102.google.com [64.233.162.192]) by postgresql.org (Postfix) with ESMTP id 77BB19FBA2D for ; Fri, 1 Sep 2006 14:26:40 -0300 (ADT) Received: by nz-out-0102.google.com with SMTP id 14so715325nzn for ; Fri, 01 Sep 2006 10:26:40 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=apyIfOLDW4jOJm5tQtJ22VapKqHoiXO7VfJjUPliwRjFQOuhEKToYW4jG7M5nUTFe7SaRsDVoA/9dV2qt2zslp4K3ty4iMFkSCYkDZIkLGymkMdIKFSf3qdP06c2T6mXWWifWuMc6QMVQCvAa7VXjIAb9Cg+QJJkgUHNTQR38Ek= Received: by 10.65.121.9 with SMTP id y9mr3089102qbm; Fri, 01 Sep 2006 10:26:40 -0700 (PDT) Received: by 10.65.61.16 with HTTP; Fri, 1 Sep 2006 10:26:39 -0700 (PDT) Message-ID: <32cabba0609011026r6616a73bhe80b336f18aa84ac@mail.gmail.com> Date: Fri, 1 Sep 2006 14:26:39 -0300 From: "Walter Cruz" To: "Andrew Sullivan" Subject: Re: help with pagila Cc: pgsql-sql@postgresql.org In-Reply-To: <20060901152116.GE17178@phlogiston.dyndns.org> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_36395_23680054.1157131599924" References: <32cabba0609010631t233d13f9o38edba0483a2446c@mail.gmail.com> <20060901152116.GE17178@phlogiston.dyndns.org> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.59 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE, HTML_30_40, HTML_MESSAGE, SPF_PASS X-Spam-Level: X-Archive-Number: 200609/3 X-Sequence-Number: 26214 ------=_Part_36395_23680054.1157131599924 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline So I can assume that the MySQL implementation is strange? (It accepts that kind of query) []'s - Walter On 9/1/06, Andrew Sullivan wrote: > > 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 > > ---------------------------(end of broadcast)--------------------------- > TIP 9: In versions below 8.0, the planner will ignore your desire to > choose an index scan if your joining column's datatypes do not > match > ------=_Part_36395_23680054.1157131599924 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline So I can assume that the MySQL implementation is strange? (It accepts that kind of query)

[]'s
- Walter

On 9/1/06, Andrew Sullivan < ajs@crankycanuck.ca> wrote:
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

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
       choose an index scan if your joining column's datatypes do not
       match

------=_Part_36395_23680054.1157131599924--