Re: short-cutting if sum()>constant

From: Ivan Sergio Borgonovo <mail(at)webthatworks(dot)it>
To:
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: short-cutting if sum()>constant
Date: 2009-12-22 17:20:06
Message-ID: 20091222182006.73810ebd@dawn.webthatworks.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Tue, 22 Dec 2009 14:48:55 +0100
Filip Rembiałkowski <plk(dot)zuber(at)gmail(dot)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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Andreas Kretschmer 2009-12-22 17:30:09 Re: short-cutting if sum()>constant
Previous Message msi77 2009-12-22 15:11:21 Re: short-cutting if sum()>constant