Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 8807A635861 for ; Wed, 22 Jul 2009 15:40:05 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 09246-02-6 for ; Wed, 22 Jul 2009 15:39:50 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by mail.postgresql.org (Postfix) with SMTP id 6FD2463F07E for ; Wed, 22 Jul 2009 15:04:43 -0300 (ADT) Received: (qmail invoked by alias); 22 Jul 2009 18:04:40 -0000 Received: from a91-154-107-53.elisa-laajakaista.fi (EHLO vanquo.pezone.net) [91.154.107.53] by mail.gmx.net (mp013) with SMTP; 22 Jul 2009 20:04:40 +0200 X-Authenticated: #495269 X-Provags-ID: V01U2FsdGVkX18ikvYB9y0igj20b6boN+iUaTfOXu36q9owX7KBmv YtLJGzFqxrEyzd From: Peter Eisentraut To: pgsql-sql@postgresql.org Subject: Re: Double aggregate problem Date: Wed, 22 Jul 2009 21:04:34 +0300 User-Agent: KMail/1.11.2 (Linux/2.6.26-2-686; KDE/4.2.4; i686; ; ) Cc: "David Weilers" References: In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200907222104.38931.peter_e@gmx.net> X-Y-GMX-Trusted: 0 X-FuHaFi: 0.6899999999999999 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.085 tagged_above=-10 required=5 tests=AWL=0.085 X-Spam-Level: X-Archive-Number: 200907/99 X-Sequence-Number: 32840 On Wednesday 22 July 2009 19:16:21 David Weilers wrote: > I have the following query: > > select v.id, array_to_string(array_accum(s.name),', ') as sector , > array_to_string(array_accum(p.name),', ') as provincie from tblvacature > v, tblaccount a , tblvacaturesector vs, tblsector s , > tblvacatureprovincie vp, tblprovincie p where v.id = 11 and v.account = > a.id and vs.vacature = v.id and s.id = vs.sector and vp.vacature = v.id > and p.id = vp.provincie group by v.id, v.inserted order by v.inserted > desc > > That currently produces the following output: No one is going to be able to reproduce that without the table definitions and data.