Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 5FE509FB362 for ; Fri, 6 Jul 2007 13:38:57 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 60136-08 for ; Fri, 6 Jul 2007 13:38:52 -0300 (ADT) X-Greylist: delayed 03:10:29.377492 by SQLgrey-1.7.5 Received: from mail.ringways.co.uk (unknown [80.193.83.130]) by postgresql.org (Postfix) with ESMTP id C35919FB356 for ; Fri, 6 Jul 2007 13:38:51 -0300 (ADT) Received: from eddie.ringways.co.uk ([10.1.1.115]) by mail.ringways.co.uk with esmtp (Exim 4.62) (envelope-from ) id 1I6qk0-0000bI-7z for pgsql-sql@postgresql.org; Fri, 06 Jul 2007 17:33:08 +0100 From: Gary Stainburn Organization: Ringways Garages Ltd To: pgsql-sql@postgresql.org Subject: Re: select from table and add rows. Date: Fri, 6 Jul 2007 17:35:39 +0100 User-Agent: KMail/1.9.5 References: <200707061425.09074.gary.stainburn@ringways.co.uk> <20070706150257.GS20115@phlogiston.dyndns.org> In-Reply-To: <20070706150257.GS20115@phlogiston.dyndns.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200707061735.39592.gary.stainburn@ringways.co.uk> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200707/39 X-Sequence-Number: 28774 On Friday 06 July 2007 16:02, Andrew Sullivan wrote: > 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 I want to be able to do away with the first line of the code, and create a select statement that would generate the three rows first, followed by the rows from the table I'm using. I want to be able to do the same job without having to pre-load the array. In other words, what's the best way to inject pre-defined rows into a select statement. -- Gary Stainburn This email does not contain private or confidential material as it may be snooped on by interested government parties for unknown and undisclosed purposes - Regulation of Investigatory Powers Act, 2000