Обсуждение: examples for windows functions

Поиск
Список
Период
Сортировка

examples for windows functions

От
Giampaolo Capelli
Дата:
Hello,
I'd like to propose to add some examples to the following page

The syntax of window functions is fully covered by the page 

but I think it would be helpful to put some examples in 

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

От
Tom Lane
Дата:
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



Re: examples for windows functions

От
Giampaolo Capelli
Дата:
Ok, but in section 3.5 I don't see examples on the "preceeding" clause.
What about enriching the section 3.5 then?

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