On Fri, 15 Mar 2002, Pestilence wrote:
> 2) The ISNULL function in both Oracle and MS-SQL takes 2 numbers and returns
> the second if the first is null, otherwise it returns the first. ISNULL in
> Postgres seems to be something quite different. Before I go writing my own
> function to do it, is there one already?
>
Coalesce
> 3) How do I do 'IF this_sql THEN that_sql'? I keep getting:
> parse error at or near "IF"
In what context?
If you mean like
IF (select * from foo) then delete from foo
kind of context, that kind of thing is availble
via pl functions but not AFAIK via direct sql.
If you mean in a select list:
select (if a is 2 then 3 else 1)
you can use CASE.