Re: insert with select as value

From: Milos Prudek <prudek(at)bvx(dot)cz>
To: Milos Prudek <prudek(at)bvx(dot)cz>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: insert with select as value
Date: 2004-06-22 15:01:05
Message-ID: 40D849B1.7000706@bvx.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bruno Wolff III 2004-06-22 15:04:58 Re: insert with select as value
Previous Message John Sidney-Woollett 2004-06-22 14:52:49 Re: insert with select as value