Re: Select case

Поиск
Список
Период
Сортировка
От Doug Gorley
Тема Re: Select case
Дата
Msg-id 1035572687.16370.13.camel@h24-69-83-179
обсуждение исходный текст
Ответ на Select case  ("Chad Thompson" <chad@weblinkservices.com>)
Список pgsql-novice
select case field
       when 'Stuff' then 'Junk'
       when 'Crap'  then 'Darn'
       end
from table

That'd ought to do what you want.

On Fri, 2002-10-25 at 11:59, Chad Thompson wrote:
> I want to be able to change the results that are output from a query like so.
>
> select field
> from table
> if field = 'Stuff' then 'Junk'
> elseif field  = 'Crap' then 'Darn'
>
> Since I am not quite sure what to look for, I have been unable to find anything in the docs.  Select case doesnt seem
todo what I want, but maybe I just dont understand. 
>
> Thanks
> Chad
--
Doug Gorley | douggorley@shaw.ca     OpenPGP Key ID: 0xA221559B
Fingerprint: D707 DB92 E64B 69DA B8C7  2F65 C5A9 5415 A221 559B
Interested in public-key cryptography?    http://www.gnupg.org/


Вложения

В списке pgsql-novice по дате отправления:

Предыдущее
От: "Chad Thompson"
Дата:
Сообщение: Select case
Следующее
От: "Chad Thompson"
Дата:
Сообщение: Re: Select case