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