Search Postgresql Archives

Re: IF function?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx> http://fetter.org/
phone: +1 415 235 3778        AIM: dfetter666
                              Skype: davidfetter

Remember to vote!
Consider donating to PostgreSQL: http://www.postgresql.org/about/donate


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux