e: Running/cumulative count using windows

Started by e-letterover 12 years ago2 messagesgeneral
Jump to latest
#1e-letter
inpost@gmail.com

test=*# select extract (year from signup_date)::text || '/' ||

extract(month from signup_date)::text, count(email_address),
sum(count(email_address)) over (ROWS UNBOUNDED PRECEDING) from test
group by 1 order by 1;

Have searched the manual and been unable to find reference to the
commands 'unbounded' and 'preceding'; can someone please advise where
to read about these commands?

On 12/09/2013, pgsql-general-owner@postgresql.org
<pgsql-general-owner@postgresql.org> wrote:

Message Digest
Volume 1 : Issue 12450 : "mime" Format

Messages in this Issue:
Danger of renaming an enum label?
Re: Major upgrade of PostgreSQL and MySQL
Re: Call for design: PostgreSQL mugs
Re: Call for design: PostgreSQL mugs
problem with query
Re: problem with query
Re: problem with query
Re: problem with query
Re: problem with query
Re: problem with query
Re: problem with query
Re: problem with query
Re: problem with query
Re: problem with query

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#2Merlin Moncure
mmoncure@gmail.com
In reply to: e-letter (#1)
Re: e: Running/cumulative count using windows

On Fri, Sep 13, 2013 at 8:18 AM, e-letter <inpost@gmail.com> wrote:

test=*# select extract (year from signup_date)::text || '/' ||

extract(month from signup_date)::text, count(email_address),
sum(count(email_address)) over (ROWS UNBOUNDED PRECEDING) from test
group by 1 order by 1;

Have searched the manual and been unable to find reference to the
commands 'unbounded' and 'preceding'; can someone please advise where
to read about these commands?

http://www.postgresql.org/docs/9.1/static/sql-expressions.html#SYNTAX-WINDOW-FUNCTIONS

merlin

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general