Re: Substitute column in SELECT with static value? - Mailing list pgsql-general

From Scott Marlowe
Subject Re: Substitute column in SELECT with static value?
Date
Msg-id dcc563d10711160819n6c7dfa4fyfe99f7ef787a38c8@mail.gmail.com
Whole thread Raw
In response to Substitute column in SELECT with static value?  (Stefan Schwarzer <stefan.schwarzer@grid.unep.ch>)
Responses Re: Substitute column in SELECT with static value? (Crosstab problem?)  (Stefan Schwarzer <stefan.schwarzer@grid.unep.ch>)
List pgsql-general
On Nov 16, 2007 4:26 AM, Stefan Schwarzer <stefan.schwarzer@grid.unep.ch> wrote:
>
> Hi there,
>
> I run an aggregation on national statistics to retrieve regional values (for
> Africa, Europe, ...). Now, I want to have a global aggregation as well. The
> easiest thing for my PHP/HTML procedure would be to have the global row make
> appear within the regional result. So it would be something like
>
>    name     |     y_2001      |    y_2002 .....
> --------------------------------------------------------
>   Africa      |      2323         |     342323
>   Europe    |     ....
>   .....
>   Global     |    849309       |    .....

> Is there a way to substitute this with a "static" value, such as "Global"?
> So, that the query still results in three columns?

Sure, just include it as 'Global'

Note the single, not double, quotes.

pgsql-general by date:

Previous
From: "Scott Marlowe"
Date:
Subject: Re: public schema doubt
Next
From: mailtolouis2020-postgres@yahoo.com
Date:
Subject: Re: public schema doubt