From: Ivan Sergio Borgonovo <mail@webthatworks.it>
Cc: pgsql-sql@postgresql.org
Subject: Re: short-cutting if sum()>constant
Date: Tue, 22 Dec 2009 18:20:06 +0100
Message-ID: <20091222182006.73810ebd@dawn.webthatworks.it> (raw)
In-Reply-To: <92869e660912220548j43a4528fu28b1389477e9fb1c@mail.gmail.com>
References: <20091222133527.3007bd96@dawn.webthatworks.it>
<92869e660912220548j43a4528fu28b1389477e9fb1c@mail.gmail.com>
On Tue, 22 Dec 2009 14:48:55 +0100
Filip RembiaĆkowski <plk.zuber@gmail.com> wrote:
> With plain SQL, no.
>
> With a user defined function in PL/PgSQL, yes.
thanks to all.
I'm on 8.3 so no CTE.
I was hoping there was some way to write it in plain SQL.
I'm planning to wrap everything in a plpgsql function using cursors
and then switch to WITH when I'll move to 8.4.
--
Ivan Sergio Borgonovo
http://www.webthatworks.it
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: mail@webthatworks.it
Subject: Re: short-cutting if sum()>constant
In-Reply-To: <20091222182006.73810ebd@dawn.webthatworks.it>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox