Re: Substitute column in SELECT with static value?

Поиск
Список
Период
Сортировка
От Scott Marlowe
Тема Re: Substitute column in SELECT with static value?
Дата
Msg-id dcc563d10711160819n6c7dfa4fyfe99f7ef787a38c8@mail.gmail.com
обсуждение исходный текст
Ответ на Substitute column in SELECT with static value?  (Stefan Schwarzer <stefan.schwarzer@grid.unep.ch>)
Ответы Re: Substitute column in SELECT with static value? (Crosstab problem?)  (Stefan Schwarzer <stefan.schwarzer@grid.unep.ch>)
Список 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 по дате отправления:

Предыдущее
От: "Scott Marlowe"
Дата:
Сообщение: Re: public schema doubt
Следующее
От: mailtolouis2020-postgres@yahoo.com
Дата:
Сообщение: Re: public schema doubt