Re: Auomatic numbering, replacing nulls and IF

Поиск
Список
Период
Сортировка
Искать
От
Stephan Szabo
Тема
Re: Auomatic numbering, replacing nulls and IF
Дата
Msg-id
20020320083324.C45997-100000@megazone23.bigpanda.com
Ответ на
Список
Дерево обсуждения
Re: Auomatic numbering, replacing nulls and IF "Ian Harding" <ianh@tpchd.org>

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.


В списке pgsql-general по дате отправления
От: Thomas Lockhart
Дата:
От: Stephan Szabo
Дата:
Сообщение: Re: no quotes in arrays in 7.2
FAQ