Re: insert with select as value - Mailing list pgsql-general

From Milos Prudek
Subject Re: insert with select as value
Date
Msg-id 40D849B1.7000706@bvx.cz
Whole thread Raw
In response to insert with select as value  (Milos Prudek <prudek@bvx.cz>)
List 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 by date:

Previous
From: Bruno Wolff III
Date:
Subject: Re: insert with select as value
Next
From: Carlos Ojea Castro
Date:
Subject: psql