Syntax for "IF" clause in SELECT

From: pgsql(at)yukonho(dot)de
To: pgsql-sql(at)postgresql(dot)org
Subject: Syntax for "IF" clause in SELECT
Date: 2006-02-08 23:12:52
Message-ID: 200602090012.52747.pgsql@yukonho.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Greetings,

the following is an MySQL statement that I would like to
translate to PostgreSQL:

Could someone point me to a documentation of a coresponding
Systax for an "IF" clause in the a SELECT,
or is the some other way to do this....

select
 if(spektrum is null,' ','J'),
 if(s19 is null,' ','J'),
 if(OhneGrenze is null,' ','J'),
 from namen;

Do I need to create my own function to allow this behaviour!

my best regards,

Stefan
--
email: stefan(at)yukonho(dot)de
tel : +49 (0)6232-497631
http://www.yukonho.de

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Bricklen Anderson 2006-02-08 23:20:45 Re: Syntax for "IF" clause in SELECT
Previous Message Ken Hill 2006-02-08 22:13:42 Re: Non Matching Records in Two Tables