Re: [QUESTION] Window function with partition by and order by
В списке pgsql-sql по дате отправления:
| От | Ankit Kumar Pandey |
|---|---|
| Тема | Re: [QUESTION] Window function with partition by and order by |
| Дата | |
| Msg-id | ec8b2c82-a74b-6bc5-c543-68a98afb8b11@gmail.com обсуждение |
| Ответ на | Re: [QUESTION] Window function with partition by and order by (Tom Lane <tgl@sss.pgh.pa.us>) |
| Список | pgsql-sql |
On 27/11/22 21:58, Tom Lane wrote: > Ankit Kumar Pandey <itsankitkp@gmail.com> writes: >> Question is: Average of id for partition name (A) should be 6/4 = 1.5 >> for all rows in that partition but this result is seen only at the last >> one row in partition (A). Am I missing here something? > https://www.postgresql.org/docs/current/tutorial-window.html > > particularly: > > By default, if ORDER BY is supplied then the frame consists of all > rows from the start of the partition up through the current row, plus > any following rows that are equal to the current row according to the > ORDER BY clause. > > regards, tom lane Thanks, I understand the behavior now. -- Regards, Ankit Kumar Pandey
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера