Skip site navigation (1) Skip section navigation (2)

Re: select from table and add rows.

From: Gary Stainburn <gary(dot)stainburn(at)ringways(dot)co(dot)uk>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: select from table and add rows.
Date: 2007-07-06 16:35:39
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-sql
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 

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     

In response to


pgsql-sql by date

Next:From: Andrew SullivanDate: 2007-07-06 16:53:33
Subject: Re: select from table and add rows.
Previous:From: Bob SingletonDate: 2007-07-06 16:25:51
Subject: Re: Iterate and write a previous row to a temp table?

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group