Re: insert with select as value

Поиск
Список
Период
Сортировка
От Milos Prudek
Тема Re: insert with select as value
Дата
Msg-id 40D849B1.7000706@bvx.cz
обсуждение исходный текст
Ответ на insert with select as value  (Milos Prudek <prudek@bvx.cz>)
Список pgsql-general
 > Is it possible to create a "SELECT max(idthread)+1 FROM table WHERE
 > idsection = 'CZE';" that will return value 1 instead of value None if
 > the SELECT has no results?

Never mind, I figured it myself. I found that there is COALESCE
function in Postgres (in Functions and Operators / Conditional
Expressions) and that it is exactly what is needed.

And Kuti Atilla send me the same answer in a private email.

Thanks!

--
Milos Prudek
_________________
Most websites are
confused chintzy gaudy conflicting tacky unpleasant... unusable.
Learn how usable YOUR website is! http://www.spoxdesign.com

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

Предыдущее
От: Bruno Wolff III
Дата:
Сообщение: Re: insert with select as value
Следующее
От: Carlos Ojea Castro
Дата:
Сообщение: psql