examples for windows functions

Started by Giampaolo Capelliover 2 years ago3 messagesdocs
Jump to latest
#1Giampaolo Capelli
giampow@gmail.com

Hello,
I'd like to propose to add some examples to the following page
https://www.postgresql.org/docs/16/functions-window.html

The syntax of window functions is fully covered by the page
https://www.postgresql.org/docs/16/sql-expressions.html#SYNTAX-WINDOW-FUNCTIONS

but I think it would be helpful to put some examples in
https://www.postgresql.org/docs/16/functions-window.html

Some example showing the use of preceding would be useful, like the
following

over (partition by col1 order by col2
rows between 10 preceding and 1 preceding
)

what do you think?

Thank you,
best regards

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Giampaolo Capelli (#1)
Re: examples for windows functions

Giampaolo Capelli <giampow@gmail.com> writes:

I'd like to propose to add some examples to the following page
https://www.postgresql.org/docs/16/functions-window.html

The syntax of window functions is fully covered by the page
https://www.postgresql.org/docs/16/sql-expressions.html#SYNTAX-WINDOW-FUNCTIONS

but I think it would be helpful to put some examples in
https://www.postgresql.org/docs/16/functions-window.html

That page starts out with a link to section 3.5 which is
full of examples. Seems a bit repetitive to put more here.

regards, tom lane

#3Giampaolo Capelli
giampow@gmail.com
In reply to: Tom Lane (#2)
Re: examples for windows functions

Ok, but in section 3.5 I don't see examples on the "preceeding" clause.
What about enriching the section 3.5 then?

<tgl@sss.pgh.pa.us>:

Show quoted text

Giampaolo Capelli <giampow@gmail.com> writes:

I'd like to propose to add some examples to the following page
https://www.postgresql.org/docs/16/functions-window.html

The syntax of window functions is fully covered by the page

https://www.postgresql.org/docs/16/sql-expressions.html#SYNTAX-WINDOW-FUNCTIONS

but I think it would be helpful to put some examples in
https://www.postgresql.org/docs/16/functions-window.html

That page starts out with a link to section 3.5 which is
full of examples. Seems a bit repetitive to put more here.

regards, tom lane