Re: IF function?

Поиск
Список
Период
Сортировка
От novnov
Тема Re: IF function?
Дата
Msg-id 10270049.post@talk.nabble.com
обсуждение исходный текст
Ответ на Re: IF function?  (David Fetter <david@fetter.org>)
Ответы Re: IF function?  (Raymond O'Donnell <rod@iol.ie>)
Re: IF function?  (Reece Hart <reece@harts.net>)
Список pgsql-general

David Fetter wrote:
>
> On Mon, Apr 30, 2007 at 10:51:36PM -0700, novnov wrote:
>>
>> Does postgresql have a built in IF function that allows one to eval a
>> condition and return one or another value? Like:
>>
>> IIF(mybooleanfield = true, "It's true", "It's not true")
>
> It has CASE, as in
>
> CASE foo WHEN true THEN 'It''s true' ELSE 'It''s not true' END;
>
> Cheers,
> D
> --
> David Fetter <david@fetter.org> http://fetter.org/
> phone: +1 415 235 3778        AIM: dfetter666
>                               Skype: davidfetter
>

I didn't express myself clearly. Is there an IIF type function one can use
inline in a view?

SELECT UserName, IIF(mybooleanfield = true, "It's true", "It's not true") as
SayIt FROM tblUser

I don't think there is, and I don't 'need' it, just could be handy once in a
while.

--
View this message in context: http://www.nabble.com/IF-function--tf3673523.html#a10270049
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


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

Предыдущее
От: "Merlin Moncure"
Дата:
Сообщение: Re: Processing a work queue
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: [HACKERS] SOS, help me please, one problem towards the postgresql developement on windows