public inbox for [email protected]
help / color / mirror / Atom feedFrom: David G. Johnston <[email protected]>
To: Guyren Howe <[email protected]>
Cc: Erik Wienhold <[email protected]>
Cc: PG-General Mailing List <[email protected]>
Subject: Re: nth_value out of more than n values returns null
Date: Mon, 4 Nov 2024 16:53:30 -0700
Message-ID: <CAKFQuwYPU+j46pHakraap1d4jYzPVMx00o95NMe0WLuamkJp+g@mail.gmail.com> (raw)
In-Reply-To: <34536f21-801c-41cb-a5ba-5389ce8201d0@Spark>
References: <3ed0759d-c332-4f96-a147-499a694e9204@Spark>
<[email protected]>
<4e60ede0-86a5-4900-b415-05d68ad75cb1@Spark>
<CAKFQuwZH2C=itB7h=S+0UiG5k=U4PsdaLKxsWenZ7GWFdAsDxA@mail.gmail.com>
<34536f21-801c-41cb-a5ba-5389ce8201d0@Spark>
On Monday, November 4, 2024, Guyren Howe <[email protected]> wrote:
> Wouldn’t it be offset 4_999_999?
>
Probably. I tend to expect off-by-one for these kinds of things and test
my way out.
>
> I’d still like to understand why nth_value doesn’t work.
>
When you perform an order by in a window clause the frame you get by
default ends at the current row. Consider “count(*) over ()” versus
“count(*) over (order by id)”.
You need to not use defaults for the window frame if this doesn’t suit you.
David J.
view thread (6+ 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: nth_value out of more than n values returns null
In-Reply-To: <CAKFQuwYPU+j46pHakraap1d4jYzPVMx00o95NMe0WLuamkJp+g@mail.gmail.com>
* 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