select from table and add rows. - Mailing list pgsql-sql

From Gary Stainburn
Subject select from table and add rows.
Date
Msg-id 200707061425.09074.gary.stainburn@ringways.co.uk
Whole thread Raw
Responses Re: select from table and add rows.  (Andrew Sullivan <ajs@crankycanuck.ca>)
List pgsql-sql
Hi folks.

In PHP I often do things such as:

$wpartners=array('all'=>'All','sel'=>'Current','mine'=>'Mine');foreach(    loadhash("select p_id as key, p_name as
value                     from partners order by p_name"                 )      as $key=>$dets) {
$wpartners[$key]=$dets;
}

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. 
-- 
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     


pgsql-sql by date:

Previous
From: Ranieri Mazili
Date:
Subject: Re: [GENERAL] Working with dates
Next
From: "Bart Degryse"
Date:
Subject: Quote problem