replace null with 0 in subselect ?

Поиск
Список
Период
Сортировка
От Albrecht Berger
Тема replace null with 0 in subselect ?
Дата
Msg-id 05f001c274fb$e8a5aba0$a07ba8c0@wxp
обсуждение исходный текст
Ответы Re: replace null with 0 in subselect ?
Re: replace null with 0 in subselect ?
Список pgsql-sql
Hello,
I have a statement like this :

INSERT INTO tab1 (c1, c2, c3) VALUES (1,2, SELECT MAX(pos)+1 FROM tab2);

This works fine if the subselect returns a value, but if it returns
null there is a problem. In this case a 0 has to be inserted.
Is there any pg function which solves this problem ?
I know that oracle has a function but I didn't find
something similar in pg.

Thanks
berger




В списке pgsql-sql по дате отправления:

Предыдущее
От: Jan Wieck
Дата:
Сообщение: Re: SQL function triggers
Следующее
От: Ludwig Lim
Дата:
Сообщение: Locking that will delayed a SELECT