How to find current row number relative to window frame

From: Art Ruszkowski <a_(at)prudenttradingsystems(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: How to find current row number relative to window frame
Date: 2013-04-26 00:06:15
Message-ID: 20130425200615.50866fd1@prudenttradingsystems.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,

I have a user defined aggregate function and in Sfunc I need to
reference current row number relative to window frame. Ideallly I would like to have following construct:

select my_aggregate(x,current_row_number_relative_to window) over
(order by y rows between n preceding and current row) as..... from ….

Any ideas how I can do this. Thanks Art.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adarsh Sharma 2013-04-26 04:22:04 Re: Replication terminated due to PANIC
Previous Message Sergey Konoplev 2013-04-25 22:34:19 Open transaction with 'idle' (not 'idle in transaction') status