public inbox for [email protected]
help / color / mirror / Atom feedFrom: Ankit Kumar Pandey <[email protected]>
To: Tom Lane <[email protected]>
Cc: [email protected]
Subject: Re: [QUESTION] Window function with partition by and order by
Date: Sun, 27 Nov 2022 22:24:51 +0530
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
<[email protected]>
On 27/11/22 21:58, Tom Lane wrote:
> Ankit Kumar Pandey <[email protected]> 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
view thread (7+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: [QUESTION] Window function with partition by and order by
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox