Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 336BF9FC89F; Tue, 5 Jun 2007 09:46:46 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 07203-03; Tue, 5 Jun 2007 09:46:33 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from oxford.xeocode.com (unknown [62.232.55.118]) by postgresql.org (Postfix) with ESMTP id B86D59FB3FC; Tue, 5 Jun 2007 09:45:28 -0300 (ADT) Received: from localhost ([127.0.0.1] helo=oxford.xeocode.com) by oxford.xeocode.com with esmtp (Exim 4.67) (envelope-from ) id 1HvYPX-0005Kl-Pa; Tue, 05 Jun 2007 13:45:19 +0100 From: Gregory Stark To: "Loredana Curugiu" Cc: "Richard Huxton" , , Subject: Re: JOIN In-Reply-To: <1c23c8e70706050518v19c56d21j873985125b930db@mail.gmail.com> (Loredana Curugiu's message of "Tue, 5 Jun 2007 15:18:18 +0300") Organization: EnterpriseDB References: <1c23c8e70706050111i5ba672d6j78bd9afa4b786616@mail.gmail.com> <1c23c8e70706050426y12d567ban70ffdafb75808e0e@mail.gmail.com> <4665537A.2060601@archonet.com> <1c23c8e70706050518v19c56d21j873985125b930db@mail.gmail.com> X-Draft-From: ("nnimap+mail01.enterprisedb.com:INBOX.sql" 288) Date: Tue, 05 Jun 2007 13:45:19 +0100 Message-ID: <87ps4ad0yo.fsf@oxford.xeocode.com> User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200706/29 X-Sequence-Number: 28519 "Loredana Curugiu" writes: > I am trying to say that sum column it is not calculated correctly. It looks like your counts are high. That would imply that your join clauses are matching more than one combination of rows. Ie, it's counting some rows multiple times because there are multiple join matches. -- Gregory Stark EnterpriseDB http://www.enterprisedb.com