X-Original-To: pgsql-php@postgresql.org Received: from localhost (developer.postgresql.org [64.117.224.193]) by developer.postgresql.org (Postfix) with ESMTP id 66BF7924D15; Tue, 27 May 2003 14:19:05 -0400 (EDT) Received: from developer.postgresql.org ([64.117.224.193]) by localhost (developer.postgresql.org [64.117.224.193:10024]) (amavisd-new) with ESMTP id 54108-10; Tue, 27 May 2003 14:19:03 -0400 (EDT) Received: from anchor-post-30.mail.demon.net (anchor-post-30.mail.demon.net [194.217.242.88]) by developer.postgresql.org (Postfix) with ESMTP id 61AFE924D23; Tue, 27 May 2003 14:19:03 -0400 (EDT) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-30.mail.demon.net with esmtp (Exim 3.35 #1) id 19Kj2L-0002G5-0U; Tue, 27 May 2003 19:19:02 +0100 Received: from localhost (localhost.localdomain [127.0.0.1]) by mainbox.archonet.com (Postfix) with ESMTP id 7F9F81754F; Tue, 27 May 2003 19:19:00 +0100 (BST) Received: from client.archonet.com (client.archonet.com [192.168.1.16]) by mainbox.archonet.com (Postfix) with ESMTP id D939C16B75; Tue, 27 May 2003 19:18:59 +0100 (BST) Content-Type: text/plain; charset="iso-8859-1" From: Richard Huxton Organization: Archonet Ltd To: Chadwick Rolfs , Frank Bax Subject: Re: [SQL] faster output from php and postgres Date: Tue, 27 May 2003 19:19:05 +0100 User-Agent: KMail/1.4.3 Cc: pgsql-php@postgresql.org, pgsql-sql@postgresql.org References: In-Reply-To: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200305271919.05735.dev@archonet.com> X-Virus-Scanned: by AMaViS snapshot-20020531 X-Virus-Scanned: by amavisd-new X-Archive-Number: 200306/2 X-Sequence-Number: 2066 On Tuesday 27 May 2003 5:34 pm, Chadwick Rolfs wrote: > So, I have the same problem, but I need all authors for each publication > to show up in it's own column. I tried the full join query from a > suggestion off pgsql-sql, but it only returns ONE author id TWICE instead > of ALL authors at once. > > I'll do some RTFMing of the joins.. and post any results I get > > BUT, right now, looping over each publication with php isn't taking that > long. I would like to know how to make this query, though! > > Please let me know how to get a result like: > ____________________________________________________ > > |All Authors|Title|Source|Year|Type|Length|Keywords| Well, if you search the archives for terms "text", "concat", "aggregate" yo= u=20 should come up with one solution. This involves writing your own aggregate= =20 function, like SUM() but for text. Don't worry, it's not difficult. The onl= y=20 issue is that you won't be able to guarantee the order of authors in the=20 field. There might be something on this in my PostgreSQL Notes on=20 http://techdocs.postgresql.org/ too - can't remember for sure. --=20 Richard Huxton