examples for windows functions

2023-10-02 Thread Giampaolo Capelli
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


Re: examples for windows functions

2023-10-02 Thread Tom Lane
Giampaolo Capelli  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