I'm new to conditional statements within postgres. I have the following statement SELECT IF status = 'L' THEN edate ELSEIF status = 'C' THEN 'wrong date' END IF as date FROM campaigns;
But I get an error
ERROR: syntax error at or near "status" at character 11
LINE 1: SELECT IF status = 'L' THEN edate ELSEIF status = 'C' THEN '...
May I use it like this or what am I doing wrong?