Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 9F9EC9FBA46 for ; Fri, 6 Jul 2007 12:03:08 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 91975-06 for ; Fri, 6 Jul 2007 12:03:03 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from main2.mycybernet.net (main2.mycybernet.net [209.222.63.140]) by postgresql.org (Postfix) with ESMTP id 6C5399FB586 for ; Fri, 6 Jul 2007 12:03:03 -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 1I6pKo-0001uy-M3 for pgsql-sql@postgresql.org; Fri, 06 Jul 2007 11:03:02 -0400 Received: by phlogiston.dydns.org (Postfix, from userid 1000) id 519673F9E; Fri, 6 Jul 2007 11:02:57 -0400 (EDT) Date: Fri, 6 Jul 2007 11:02:57 -0400 From: Andrew Sullivan To: pgsql-sql@postgresql.org Subject: Re: select from table and add rows. Message-ID: <20070706150257.GS20115@phlogiston.dyndns.org> References: <200707061425.09074.gary.stainburn@ringways.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200707061425.09074.gary.stainburn@ringways.co.uk> User-Agent: Mutt/1.5.9i X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200707/37 X-Sequence-Number: 28772 On Fri, Jul 06, 2007 at 02:25:08PM +0100, Gary Stainburn wrote: > This sets up an array with some pseudo values and then populates it with > *proper* values from a table. > > How's the best way to do this all within SQL. I'm obviously not understanding the question properly, because I think you want ot set up a PHP array with values from your table, without using PHP. Which would of course make no sense. Do you mean, how do you populate an array data type with data from individual database columns? A -- Andrew Sullivan | ajs@crankycanuck.ca However important originality may be in some fields, restraint and adherence to procedure emerge as the more significant virtues in a great many others. --Alain de Botton